Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2013-06-10
12
308 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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

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.

Question has a verified solution.

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

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…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

840 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