javascript - Get style of image on onclick -
this code:
<ul id="carousel"> <li><a class="group cboxelement" href="images/airingcupboard0_2.jpg"> <img src="images/2013042517364073_airingcupboard0_2.jpg" alt="image not found" title="airingcupboard0_2.jpg" style="width: 144px; height: 192px; opacity: 1"> </a></li> <li><a class="group cboxelement" href="images/airingcupboard0_3.jpg"> <img src="images/2013042517364073_airingcupboard0_3.jpg" alt="image not found" title="airingcupboard0_3.jpg" style="width: 144px; height: 192px; opacity: 1"> </a></li> </ul>
to fetch particular name tried javascript
var img_name = document.getelementsbyclassname('cboxphoto')[0].nameprop; var $img_panel_id = $('#carousel').find('li img' + img_name); $img_panel_id.parent().attr('style');
lets img_name airingcupboard0_3.jpg
how can fetch style of image tag
you can image titles ...
$("#carousel").click(function() { $(this).find('img[title="airingcupboard0_3.jpg"]').attr("style"); });
Comments
Post a Comment