Click here to Skip to main content
13,089,818 members (45,277 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am new to jquery and can't find seem to figure why it works in everything but IE

<script type="text/javascript" src="""></script>
<ul class="slides">
  <li class="screenshot"><p>Text 1</p><img class="phone" src="one.png"></li>
  <li class="screenshot"><p>Text 2</p><img class="phone" src="two.png"></li>
  <li class="screenshot"><p>Text 3</p><img class="phone" src="three.png"></li>
  <li class="screenshot"><p>Text 4</p><img class="phone" src="two.png"></li>
  <li class="screenshot"><p>Text 5</p><img class="phone" src="three.png"></li>

 $(function () {
        $('#right-arrow').click(function (ev) {
            var $visibleImage, total, stack;
            $visibleImage = $('.screenshot:visible');
            total =  $('.screenshot').length;
            stack = $visibleImage.prevAll().length;
            $(this).attr('href') === stack++;
            if (stack === total) {
                stack = 0;
                $('.screenshot:eq(' + stack + ')').fadeIn('slow');
Posted 28-Feb-13 19:47pm
markovl 1-Mar-13 1:53am
What do you mean by not working? Is there an error? Or the script doesn't get called? Or jQuery is not loaded?
There is not enough information in this question as is.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You're not giving us enough information to go on, but this code seems to run fine in both IE7 and IE8 on my machine (using JQuery version 1.8.2). It does exactly what you're telling it to in the code - when a button's clicked it fades out all images on the page and then fades in the one the 'stack' counter is currently pointing to.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 1 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100