Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hm look like trigger just calls the handler you set (in your example the alert is displayed). It doesn't set the :hover css style.</p> <p>jQuery doumentation says:</p> <blockquote> <p>trigger() - Execute all handlers and behaviors attached to the matched elements for the given event type.</p> </blockquote> <p>I am not exactly sure what you are trying to do, but if you just want to cycle through the links of a certain class, get the href and display the image it points to you could do something like this:</p> <p>Heres a jsfiddle of the code: <a href="http://jsfiddle.net/G6AbM" rel="nofollow">http://jsfiddle.net/G6AbM</a></p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;script src="http://code.jquery.com/jquery-1.8.2.min.js"&gt;&lt;/script&gt; &lt;style type="text/css"&gt; body {color: #000; text-align: center} .myLink { text-decoration: underline; } &lt;/style&gt; &lt;script type="text/javascript"&gt; $.onReady = new function() { setTimeout(imageChange, 500); } var nextImage = 0; function imageChange() { var elements = $('.myLink'); $('#currentImage').text(elements[nextImage].href); if (++nextImage &gt;= elements.length) { nextImage = 0; } setTimeout(imageChange, 500); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="#link1.jpg" class="myLink"&gt;Link 1&lt;/a&gt; &lt;a href="#link2.jpg" class="myLink"&gt;Link 2&lt;/a&gt; &lt;a href="#link3.jpg" class="myLink"&gt;Link 3&lt;/a&gt; &lt;br&gt; &lt;span id="currentImage"&gt;..&lt;/span&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload