0
私のアプリケーションでjqueryスライダーを使用しています。入力された入力タイプに画像URLパスがあります。 "#1 IMG-パス - " 私は するvar image_path_id =に "jqueryで一意の番号を持つdivのIDを取得するには?
img-paths- <?php echo $omsg_id; ?>
" $ omsg_id値を取得したい+ $(この).dataセクション( 'ID');
私は火のバグで印刷コンソール、出力はそれを解決する方法#1 IMG-パス-未定義
でしたか?
<div class="post-image">
<?php $imagePathArray = explode(',',$uploads); ?>
<input id="img-paths-<?php echo $omsg_id; ?>" type="hidden" value="<?php echo htmlentities(json_encode($imagePathArray)); ?>" />
<div id="gallery7-<?php echo $omsg_id; ?>" ></div>
<script>
$(function(e) {
var image_path_id = "#img-paths-"+$(this).data('id');
var show_gallery_id = "#gallery7-"+$(this).data('id');
console.log(show_gallery_id);
console.log(image_path_id);
$(show_gallery_id).imagesGrid({
images:$.parseJSON($(image_path_id).val()),
align: true,
getViewAllText: function(imgsCount) { return 'View all' }
});
});
</script>
<!--<img src="<?php //echo $contentimage; ?>" class="image show-in-modal" alt="image post">-->
<p><?php echo $message; ?></p>
</div>
ありがとう@Saptalそれは働いた! – Sayuj3