Solved

Javascript function not working on Internet Explorer (only), possibly older versions?

Posted on 2013-06-10
12
306 Views
Last Modified: 2013-06-10
On this page:
http://www.lieverhymanpotter.com/videos.php

If you click the LEFT and RIGHT arrow buttons, it should scroll through thumbnails of the six videos (Jim Potter on the far left, Mike McGuckin on the far right).

This works fine on every (up-to-date) browser I have, both Macintosh and Windows.

My client is insisting the RIGHT arrow does not work on their computers (but the LEFT does). They have tried multiple computes, I believe they are all running Internet Explorer, but I don't know what version.

Here is the jQuery/Javascript for the RIGHT arrow:

$('#videoArrowRight').click(function(){
	console.log($('#videoSlideShow').position().left);
	if ($('#videoSlideShow').position().left<=-552){
		$('#videoSlideShow').animate({left:'-=20px'}, 200);
		$('#videoSlideShow').animate({left:'+=20px'}, 200);
	} else {
		$('#videoSlideShow').animate({left:'-=184px'});
	}
});

Open in new window


I can't understand where the problem would be, or why only their computers would have the problem. I can't run any kind of developer tools on their computer to see what is going on, either.

Any advice? Thank you!
0
Comment
Question by:bbdesign
  • 4
  • 4
  • 3
  • +1
12 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39235623
Would be better with a live link, a few lines of js tell us nothing.
0
 

Author Comment

by:bbdesign
ID: 39235631
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39235640
In IE8 on Windows XP SP3, the right arrow does not work.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 4

Expert Comment

by:BAKADY
ID: 39235646
i had problems with a client because IE7/8 and jquery too.
IE8 make really stress in your CSS layout, try z-Index to get your Left/Right Arrows in foreground. Animate don't works fine either, i had something like this $('myObject').animate({opacity:0}); and visibility, i was crazy around a week because this...
i made 2 WM with IE 7 and IE 8, i tried the page with each update that i found... and everything was working, but the client said: "all errors are here, nothing is changed"
finaly i had to go to the client, i cleared the IE cache and reload the page... then was everything fine...

good luck
0
 

Author Comment

by:bbdesign
ID: 39235664
DaveBaldwin... as you can see in my script, I have a console.log displaying the position of the slide element whenever the right arrow is clicked. Are you able to launch a Javascript console in IE8 on Windows XP SP3 and let me know if that is displaying? That would at least tell me whether or not the function is firing.

Thanks!
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39235674
Console log will not work in IE8 (unless you have developer tools open) - this may be breaking the code.
Now I'm guessing they are using IE8....
Need to know the version else we're chasing our tails
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39235689
That was interesting.  When I pressed F12 to bring up the Developer Tools, it started working.  After I closed IE8 and restarted/reloaded the page, it didn't work again.  I'm wondering if the 'console.log' line is actually the problem.  Make second page without it like 'videos2.php' and let us try that.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39235691
Beat you to it Dave...
0
 

Author Comment

by:bbdesign
ID: 39235708
I took the console.log out, can you verify if that fixed it? There was no console.log on the LEFT arrow, which might explain this. I can't believe this whole issue was caused by that (actually, I could)... I thought console.log was pretty benign. I guess not.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39235719
Working fine now
You could check if the console is present with
if (window.console && 'function' === typeof window.console.log) {
  //do logging
}
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39235748
Yep, appears to work fine now... even if Gary got there first.
0
 

Author Closing Comment

by:bbdesign
ID: 39235833
Thanks guys!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lazy load not working with masonry js 1 17
When we use cache:false ajax? 1 32
simple javascript form validation 2 18
jqury 17 28
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

786 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