在jquery中显示下一个图像的问题

时间:2013-11-23 11:56:17

标签: javascript jquery html css html5

我参考了这个网站http://jsfiddle.net/8FMsH/1/

// HTML

$(".rightArrow").on('click',function(){
imageClicked.closest('.images .os').next().find('img').trigger('click');
});

但它没有移动到下一个图像。以下是块包含和显示图像。

<div class="images">
<img class="os" id="1" src="http://labalec.fr/erwan/wp-content/uploads/2013/09/ubuntu_large.jpeg" alt="ubuntu">
<img class="os" id="2" src="http://betanews.com/wp-content/uploads/2013/06/windows-8.1-start.jpg" alt="windows" >
</div>
<div class="overlay"> </div>
<div class="slideshow">
<img class="rightArrow" src="http://upload.wikimedia.org/wikipedia/commons/7/7d/Aiga_rightarrow_inv.gif" alt="rightArrow" >
<img class="popup" src="" alt="clickedImage" >
</div>

请有人帮助我

1 个答案:

答案 0 :(得分:0)

Pleas give all js,css, & js to review. If you are using only this js, it will not work. 
In given js there is lots of problems.

  imageClicked not defined.
  trigger('click') will only work if you define some functions with img selectors.
  ('.images .os').next().find('img') will not find anything.