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.
I was having a problem with rollovers, even though I do them in a very conventional way:
function roll(i) { document[i].src = eval(i + "_roll.src") } // in which value passed to function is "name" attr in img tag..
but on my home page, www.francesdelrio.com, I have rollovers like this:
function doRoll(Img,newImage) { Img.src = newImage.src; Img.width = newImage.width; // what's the point Img.height = newImage.height; // of these two? } function roll_web() { doRoll(document.web, web_roll); } // etc.
I'm just trying to remember why I did it like this, it was a solution given to me by someone in this ng, I believe the problem might have been that rollovers were not working in Opera (don't have Opera installed anymore, can't check it out); does this mean all my other rollovers are not working in Opera? (if you have Opera, can u pls go to www.francesdelrio.com/resume in Opera and roll over images near top of page and see if rollovers work? How prevelant is use of Opera? do I need to always script taking Opera into account?
Is it possible to do roll overs over an area of an image. I know you can setup up a hotspot but can a roll over be done on that particular hotsop. Additionally, when the image changes on the roll over, can a certain area of this new image be shown instead of the whole one?
probably one thats been heard often, but i have an onmouseover and onmouseout event, which basically swaps between two images. but how can i also get it to change an image elsewhere on the same page?
Im working on my moms website and had this crazy idea to have rollover images for buttons.
The thing is the "mouseover" images seem to just starting to load when you hover over the link which ruins the whole effect.I used different codes, even stuff that was recomended in this forum but nothing works. ok this is what gets me: I uploaded the same page to 2 other servers and my rollovers work just fine there. Code:
I've just built a site for a client (in spanish), it's about 90% finished-I've uploaded it and it looks great on my computer. The problem is that on every other computer I've checked-the left nav rollovers do not work (only on my computer do they work).
I finally got A rollover to work but now I'm having trouble with multiple ones. The first one works fine, but none of the others do, just says that there is an error on the page. Please help as I'm about to go bold from ripping my hair out... I mean everything looks good to me. But I don't know much so here. Code:
My navigation buttons have rollovers and are working fine in FF, Safari, Netscape, Camino but not in IE.
Not only that but there are some weird dashes appearing between some of the buttons. I do notice that the dashes disappear when I hover the cursor over some of the buttons. Can't figure it out... Code:
I'm really new at JavaScript, but I thought an image map with rollover images would be a relatively basic feat... I have a large map with hotspots over individual states. I want the user to hover over a hotspot and for the main image to change, displaying information for that particular state. I've tried code that other developers have sworn works in all browsers, but still can't get the same functionality in FF or Chrome as I do in IE.
<SCRIPT language="javascript" type="text/javascript"> function swapImage(image) { var Map = (document.getElementById) ? document.getElementById('MapWest') : (document.images) ?
<!-- hide from browsers that dont support js if(document.images) { about_over = new Image about_over.src = "images/btn_about_r.gif" about_out = new Image about_out.src = "images/btn_about.gif"
success_over = new Image success_over.src = "images/btn_success_r.gif" success_out = new Image success_out.src = "images/btn_success.gif" } // -->
and i am using it from within the html code in a standard way:
question: i don't know much about javascript. i know that the script above preloads the images but i don't understand why the images reference names ( "about_over", "about_out", etc) do not get utilized within html code. it seems to me that they should be used.
I need a preload script that will load say 5 images...but it need not include any coding for rollovers. I have a site that offers some info to read on the index page...so before going into the main site, and I'd like to use the time that the visitor spends on the first page to preload images that are displayed on the next page. Obviously the goal is to speed up the load-time of "page2," while not making it apparent that it's happening on "page 1" ... does that make sense? Code:
i am creating a header for a webpage. the header has two text menus (no images). the first menu (menu A) is like this: link 1a / link 2a / link 3a
the second menu (menu B) is like this:
link 1b link 2b link 3b
i would like to use javascript/css to do the following: when you rollover link 1a, three things happen: link 1a changes color, link 1b changes color, and and link 1b adds a line of text (so it reads: link 1b : text 1b)
i would also like- and this is where i am having trouble- for the following to happen: when you rollover link 1b, link 1b changes color and adds the additional text, as well as link 1a changes color.
I have seen this quesion asked in various forms but the general idea of the question is "How do I make a rollover image clickable". Usually the asker wants to have the image stay on when clicked. Here is a little script that will do that and more..
This is the main code that goes in the HEAD section of your document.
<script type="text/javascript"> <!-- /** * Dual/Tri/Quad state rollovers from www.javascript-fx.com * posted at and available from www.codingforums.com * You may use this code on any website but please * leave this comment intact. */ var img= new Array(); var di= document.images; var currOn= null;
NOTE: The name if the image must match the Rollover name --- <img name="home" --- Rollover("home", "images/home_off.gif", "images/home_on.gif");
If you use the script in this form you will get something like this demo Dual State Rollovers (http://www.javascript-fx.com/post/codeforums/quadroll/QuadState2img.html) ------------------------------------------------------------------------ If you want the clicked image to be a third image you define the rollovers as follows :-
Where the syntax is Rollover(Name, offImage, onImage, clickedImage)
Which results in this demo Tri State Rollovers (http://www.javascript-fx.com/post/codeforums/quadroll/QuadState3img.html) ------------------------------------------------------------------------------------ If you want to have a clicked image and have that clicked image also have a (different) rollover effect you define the rollovers as follows :-
I am trying to create some rollovers using the following scenario. I have four groups, let’s say hearts, diamonds, clubs and spades. Each of these groups have a varied amount of members. For each group, there is a short description of what the group is supposed to do, and then thumbnails of each of the members.
To the right of the thumbnails is an image that holds a standard image, but would change to the enlarged picture of the member when the mouse is over the member's thumbnail, and below that image is another area which will hold the person name and position if any within that group. Basically there are four rollover groups. I can do the rollover for an image okay as in this code, adding more variables and images as necessary using something like this. Code:
I am not very well versed in js, but am attempting to figure this out. (Gotta start somewhere, right?) I want this to be unobtrusive js, if possible with no js specifics in the html (though additional or changes to classes/IDs would be fine). I've started with PPK's mouseover script, which is working just fine. To this, I want to add some onclick behaviors. Code:
I'm trying to get rollover images to work that are a little more complex than usual. I have a webpage that presently gives information on four groups within an organization. I've put each group within its own div with an id. The div contains a short description of what the group does, thumbnails pictures of each member of the group, and to the right of these thumbnails, a larger picture. This larger picture is supposed to change, when ever the mouse is over a thumbnail to a normal size picture of the thumbnail, for the first part.
I tried to put in a script that will preload all the original images that should be changed. First I created an array with all the names of the divs, then used two for loops, one nested inside the other to get the pictures into the array. Tried to get the names of the array to hold the pictures from the first array with the names (inames), using a two dimensional array (used an example from a post on this forum) but it seemed to have gone astray, as the onmouseover doesn't work. Code:
Ultimately I'd like a set up resembling http://shop.lululemon.com/Swift_Tank...30/p/1230.html
Where you're able to click a swatch color and get a thumbnail of it on the model and a thumbnail of a fabric detail that you could then enlarge. I'm not sure how to go about this. I'm able to do it with one thumbnail, where when you rollover the various swatch colors, the thumbnail of the model gets replaced. However I'm unable to add in the 2 other thumbnails (on that site they're using 3 but I would only need 2) that would change at the same time, where you could switch back and forth from at detail of the model and the fabric.
I don't necessarily need the zoom function, but if it is possible to do all of those that would be good too.Otherwise I just need help coding how to at least get the swatches to change 3 images upon mouseover and that 2 of those images would be like the 3 thumbnails on the link above and would replace the larger thumbnail once clicked.
Does anyone know of a good MIT-Licensed, or MIT-style image swap and disjointed rollover solution? All the ones I've seen are either GPL or personal-use only. The examples of img replacement scripts I've seen on stackoverflow are either only for personal use (I believe every example on the site is personal only, unless stated?), or too narrow in scope.
Any help would be great as the docs.jquery.com site has great demos on almost everything except how to swap images. I don't mind if its a block of code or a plugin, although preferrably something small and simple would be great.
It sounds like a big ask, but I thought I would ask as this place is super-friendly, unlike some of the other js libraries' forums' I've been to.
I'm using jquery with wordpress to display custom fields for rollovers.
The issue that I'm having is that I'm using the same div class to dynamically pull images from custom fields with in a post. when I do this, every time I rollover one image all the images switch to their rollover state. I figure I need an array to get them to function individually.
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?
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();
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.