divs
表示prepend
されているのクラス名を取得してから、取得したクラス名の小数を取得しようとしています。どんな助けでも素晴らしいでしょう、ありがとう。
これが私がこれまでに持っているものです。
$('#imagefiles ul li img').click(function() {
var open = $(".open:visible").attr("class");
var n = open.split(",");
alert(n);
});
1つだけdiv
が表示div
され、2つのクラス名が付けられます。
このようなクラス名を取得することの全体的なポイントは、をappend
含む開いているフォルダーに画像を表示できるように<div class="edititable">
することです。このコードを試しても何も起こりません。何かご意見は?
$('#imagefiles ul li img').click(function() {
//Get the source of the image that was clicked
var img = $(this).attr('src');
//Grab the class name of the opened folder and prepend a decimal to it.
var classes = $(".open:visible").attr("class").split(" ");
var classesWithDot = "";
$.each(classes, function (index, value) {
classesWithDot += " ." + value;
});
$(' + classesWithDot + ').find('.edititable').append('<img src="' + img + '" style="width:30%; height:30%;" ">');
});