Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6228721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:26:17+00:00 2026-05-24T09:26:17+00:00

I have an image slideshow, which has a small DIV on top of it

  • 0

I have an image slideshow, which has a small DIV on top of it for ad copy. Every time the slide changes, the ad box fades out, and a new one fades in, in a different position.

This works great in every browser but IE. All of my jQuery animations are working fine, but for some reason the box won’t change position. Both .css() to change my top/left values and actually changing the class using .attr() fail in IE.

Here is the JS to change the class, and show the box. The first line simply gets the position from the filename (image-6.jpg).

var heroPosition = vars.currentImage.attr('src').substr(-5, 1);
switch(heroPosition) {
  case "1":
    $('#hero-ad').attr('class','hero-position-1');
    break;
  case "2":
    $('#hero-ad').attr('class','hero-position-2');              
    break;
  case "3":
    $('#hero-ad').attr('class','hero-position-3');
    break;
  case "4":
    $('#hero-ad').attr('class','hero-position-4');
    break;
  case "5":
    $('#hero-ad').attr('class','hero-position-5');
    break;
  case "6":
    $('#hero-ad').attr('class','hero-position-6');
break;
}
$('#hero-ad').show("fold", {}, 1000);

The code itself was sort of hacked into the Nivo image slider.

The live site is here http://www.sugarloaf.com/slredesignlocal/index.html

Most of the JS in js/plugins.js. CSS for the positions is in css/style.css

EDIT I should mention that I tried using .addClass() and .removeClass() and this method also failed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:26:18+00:00Added an answer on May 24, 2026 at 9:26 am

    I’m guessing you are having this problem specifically in IE because you are using substr() with a negative number. Check out this post. You should consider using slice() instead to get the value you’re expecting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple slideshow which automatticlly changes the image using setInterval every 5
I have a div which currently has a static background image. I need to
I have a page which has a slideshow at the top, and images inserted
I have an image slideshow with navigation, with which I want to add an
i have created a slideshow, using jquery which has fade effect, the problem with
I have a slideshow built in jquery which stores image urls in an array.
I have this drupal slideshow which pulls images from a folder sequentially by image
I have the following code: <div id=slideshow > <div class=check> <img src=images/slideshow/image01.jpg alt=Slideshow Image
I have created a 4 image endless slideshow, which works more or less well
I have an audio track with an image slideshow - e.g. there's image 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.