Has anyone else had this issue? Basically, the preload of images for a
rollover effect for the navigation is really really slow when using IE
6.0 but when i view the site using Netscape, it's fast like it should
be(no lag!)
My problem is that since 96% of users use IE, i need to figure a way
to fix this. Below is the javascript currently being used. The
arguments are passed in before the script is called.
function gn_rollover_preload(){
//preloads middle images for the navigation
if (document.images){
var argLength = gn_rollover_preload.arguments.length;
for (arg=0; arg < argLength; arg++){
eval(arguments[arg] + "_off = new Image()");
eval(arguments[arg] + "_on = new Image()");
eval(arguments[arg] + "_left = new Image()");
eval(arguments[arg] + "_right = new Image()");
// Now Preload all "corner" images for faster swapping
corner1 = new Image();
corner2 = new Image();
corner2_both = new Image();
corner3 = new Image();
corner3_both = new Image();
corner4 = new Image();
corner4_both = new Image();
corner5 = new Image();
We're developing an ASP.NET / C# intranet application. All users use Internet Explorer 6.0 and JavaScript is always enabled.
In a HTML table, we use an onclick event on each tablerow and in that onclick event (javascript) we save some values in hidden fields.
Most of the time, this works very fast, but it also happens a lot of times that the internet browser respons very slow or gets stuck. We really don't know what causes this, because in the javascript we do only simple things such as setting values in hidden fields.
Is there anyone who recognizes this problem and knows some possible solutions?
Images are cached by the browser depending on the headers sent by the server. If the server does not send sufficient information for the browser to decide the image is cacheable, the browser will check if the image has been updated every time you change the src of an image (in some user settings). To overcome this you must send suitable headers.
As far as I can tell, there seems to be a distinct lag time in IE before the switch from the 'off' to the 'on' image, and vice versa, which doesn't seem to exist in Mozilla.
Is this something that can be fixed by tweaking the script?
The script, btw, is pretty ancient, so I expect it may contain some outdated stuff. I found it years ago when looking for a script that would allow me to easily customize the number of target images changed by a single onmouseover/onmouseout action. Since I don't actually know javascript, I tend to stick with the ones I've learned to at least do basic customization of.
I've got the following site that loads great in FF and Chrome (no surprise), but is terribly slow in IE7. It's even quick in IE6, but not 7. Here's the site code...
Now I'm using JQuery in a couple places, but it's by no means nothing crazy. The page is fairly simple.
I thought of preloading the main content images, but even after they are loaded in the cycle, the loading time is still slow.
I have a div that is invisible all the time, and when one popup is activated, that div will fade in to darken the website background, like this: And I'm using the following code when the darkness appears:
PHP Code: function raiseOpacity(obj,counter) { obj.style.opacity = counter/100; counter +=2; //Raise 2% each time if(counter < 100) setTimeout(function() {raiseOpacity(obj,counter)},10); //Repeat the incrementation again}raiseOpacity (document.getelementbyid('example'),0); //Just an example of how the function is called.
But it is too slow, the browser hangs alot while doing this. Is there a faster way to do this fade in stuff? I've seen a lot of websites that do this and the browsers is fast, but I couldn't extract the code from them.
i've encountered a problem with the way the drag events are handled in this file, but it had an easy fix. I have a slider (a draggable div) and dragging it involves a lot of processing power. The problem arises if the mouse pointer seperates itself somehow from the element being dragged (by, say, a spike in CPU usage or something). the x_drag library file registers a mouseup listener on the object which is being dragged, but that doesn't do any good if the mouse pointer tracks so much as one pixel off the dragged element.
I've encountered this in almost every situation where i have draggable elements. Thankfully, it's a real easy problem to solve: if the mouseup events are registered on the document itself, there's nothing to worry about, because any old mouseup will end the drag.
I put a javascript for a preload in it and it hasnt helped the front page. Right now the header is swish and we took that out and it still took over 2 minutes to download on DSL. I do have the JS anthology book but the script in there didn't work for us. Come to think of it I have almost all of the sitepoint books. Does anyone have any suggestions.
I have installed Lightbox 2 Lightbox 2 for a client's site redo, and we are concerned about the opening speed of Lightbox for those on a slower Internet connection. Lightbox is only for those visitors who want to see images in a larger view. Is this something we should be concerned about? Are their other choices that would be better?
I have tried several preload scripts found here; plus, some of my own. The only thing that works is the unsophisticated loading of those tiny images. The download consist of 100+ images amounting to 50+mb; and, normally completes in less than 1 minute without preload (using DSL).
The preload terminates after 6 or 7 images and seems to time-out in the middle of an image. A reload will download a few more, etc. I have used the <body onLoad=function()> approach as well as the non-function approach of JS that executes immediately with the page's loading. Getting the same results with Netscape-7 and IE-6.
I need to add: The source of the array containing the image references is a '.js' file. That doesn't seem pertinent as some of the images always load.
I´m using dreamweaver´s built in preloader for a menu. it looks like this:
function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
Want to know if there is a way to preload a song before the slide show starts. Also, would like to be able to show the lyrics 2 paragraphs at a time, timed with the singer so viewers don't have to scroll to see the lyrics. The lyrics are currently just in a table row with the <td> tag. I would have to have a timer start with the execution of the song, and replace the lyric text as the singer completes each verse.
Or, can you link the photo image with the scroll bar so if they scroll, photo will scroll so they can still see it as they view the lyrics.
I really have little idea of what I am doing, and have gotten to where I am by lifting various scripts off the Internet. Any help would be greatly appreciated. Please keep in mind I am a web designer IDIOT.
im working on a webpage with rollover buttons, and im noticing that on everylink of the page the page reload the buttons again,and again, is there something i can do to use them from cache instead load them every time? it could save time for audience and bandwith for the hosting :) the rollover was made for imageready Code:
I would like to preload all images on a certain page, without 'knowing' which pictures are on the page. (I want to write a .js file, put in the header of all the pages)... So, I don't know what pictures are on the particular pages.
Can this be done? If so, how?
Than another question (if the above is possible)... Say, one of the 'found' pictures can't be loaded (it's not in the correct folder)... can this pictures be replaced with another picture? (for instance: pic_not_found.jpg).
I have attempted to create an external js page that handles preloading and rollovers. The idea is to save some bandwidth by not having this code in the head of every page.
The problem I am encountering is that I have the script doesn't seem to want to work properly through out my file structure which can be seen here.
I got a script that rotates my images, but I have almost 300 in stock and it is preloading all 300 once the script is started. How do I get it to preload one at a time, or nothing at all? Code:
the first 4 tabs are showing some images as background:clicking the tabs will trigger a fading-effect, but as long as the user hasn't watched the 4 images, the effect is "interupted" by the loadingprocess of the images. is it possible to preload those images so that they are in the browsercache or something?
I know that there are scripts on preloading images in order to load page faster.I want something else but for text,in order to load text faster on my page.
Recently submitting forms (specifically forms which have javascript attached to them with the submit function) has become very slow. The browser appears to sit there for seveal seconds doing nothing (the page also becomes non responsive) and then suddely loads quickly. This happens on all of my computers... What's happened to javascript? Is there some setting that's been turned on that I'm missing?
I am attempting to modify the style of an element (its width) as the window is being resized, in firefox.
Long story short, I've tried to use CSS but one particular part of the layout just won't do what I need.
The javascript solution assigns a function to window.onresize that sets the inline style, it works with one problem -- the handler only gets called after the resizing stops, and so there is noticeable lag before it redraws.
It is not the function that is taking a long time to execute, its appears to be firefox's handling. It doesn't call it as frequently as I expected.
Is there another javascript method to accomplish this without the extra lag?