Solved

Fading caption transition requires page reload in IE

Posted on 2014-03-13
4
203 Views
Last Modified: 2014-03-18
I have a horizontally-scrolling feature at www.mauivacationrental.com/view.htm   There are three images which scroll sequentially, and then repeat.  The caption transitions in sync with the image on the screen, using javascript and css.  This works under all major browsers except IE.  The first caption transition is consistent, but the next two often require a page reload.  Is there a way to improve the caption performance under IE?
0
Comment
Question by:ddantes
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Rartemass
ID: 39928683
Which version of IE are you testing in?
0
 

Author Comment

by:ddantes
ID: 39929894
Currently IE11.  However, I noticed this behavior in IE10 previously.
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 39936456
The current scroll position is used to determine which text element needs to be shown so the varying speed of the scroll, while annoying and probably fixable, should not cause problems with that.

It seems to be a timing issue regarding the image.load function which sets the 'pw' variable.

Try getting rid of the document ready function where the image.load function is set
$(document).ready(function(){
// comment this out or just delete the whole document.ready function
// document.getElementById("pic1").onload = function() { pw = document.getElementById("pic1").width; };
});

Open in new window

and instead doing it directly from the image tag:
document.write('<img id="pic1" src="images/view.jpg" alt="" onload="pw=this.width;"><img id="pic2" src="images/view.jpg" alt="">')

Open in new window

0
 

Author Closing Comment

by:ddantes
ID: 39937552
That did it!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now