Why Are My Rollovers So Slow?
Nov 8, 2007
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.
View 7 Replies
ADVERTISEMENT
Jul 23, 2005
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?
View 2 Replies
View Related
Jul 23, 2005
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?
View 3 Replies
View Related
Mar 13, 2007
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?
View 10 Replies
View Related
Feb 2, 2004
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:
View 2 Replies
View Related
Aug 6, 2002
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).
View 5 Replies
View Related
Jan 18, 2003
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:
View 1 Replies
View Related
Jun 4, 2006
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:
View 2 Replies
View Related
Aug 29, 2009
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) ?
[code]....
View 4 Replies
View Related
May 18, 2003
i have the following javascript code:
<!-- 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:
<a href="about.php" onMouseOver="document.about.src='images/btn_about_r.gif'" onMouseOut="document.about.src='images/btn_about.gif'"><img src="images/btn_about.gif" name="about" width="56" height="23" alt=""></a></td>
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.
View 3 Replies
View Related
Nov 3, 2003
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:
View 5 Replies
View Related
Jan 19, 2007
Without using CSS styles or linked stylesheets, I need to apply
formatting to text links that use rollover effects.
I can NOT get the underline to show using this technique:
View 5 Replies
View Related
Dec 8, 2009
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.
View 8 Replies
View Related
Sep 13, 2002
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;
function Rollover(imgName, imgOut, imgOver, imgClick, imgClickOut)
{
if(imgClick == null)imgClick = imgOver;
if(imgClickOut == null)imgClickOut= imgClick;
var roll = new Object;
roll.out= imgOut;
roll.over= new Image();
roll.over.src= imgOver;
roll.click= new Image();
roll.click.src= imgClick;
roll.click_out= new Image();
roll.click_out.src = imgClickOut;
img[imgName] = roll;
}
function mOver(imgName)
{
di[imgName].src = (imgName != currOn) ? img[imgName].over.src : img[imgName].click.src;
}
function mOut(imgName)
{
di[imgName].src = (imgName != currOn) ? img[imgName].out : img[imgName].click_out.src;
}
function mClick(imgName)
{
if(currOn != null) di[currOn].src = img[currOn].out;
currOn = imgName;
di[currOn].src = img[currOn].click.src;
}
function mSelect(imgName)
{
mClick(imgName);
mOut(imgName);
}
/*** End the rollover code ***/
//-->
</script>
This is the code to define rollovers and is also placed in the HEAD of your document
<script type="text/javascript">
<!--
Rollover("home", "images/home_off.gif", "images/home_on.gif");
Rollover("email", "images/email_off.gif", "images/email_on.gif");
Rollover("script", "images/script_off.gif", "images/script_on.gif");
Rollover("links", "images/links_off.gif", "images/links_on.gif");
Rollover("special","images/special_off.gif","images/special_on.gif");
//-->
</script>
Where the syntax is
Rollover(Name, offImage, onImage);
Then to use the code in a rollover image the HTML in the BODY of your page should look like this
<A HREF="#"
onClick="mClick('home');"
onMouseOver="mOver('home');"
onMouseOut="mOut('home');"><img name="home"
src="images/home_off.gif" border=0></A><br>
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 :-
<script type="text/javascript">
<!--
Rollover("home", "images/home_off.gif", "images/home_on.gif", "images/home_clk.gif");
Rollover("email", "images/email_off.gif", "images/email_on.gif", "images/email_clk.gif");
Rollover("script", "images/script_off.gif", "images/script_on.gif", "images/script_clk.gif");
Rollover("links", "images/links_off.gif", "images/links_on.gif", "images/links_clk.gif");
Rollover("special","images/special_off.gif","images/special_on.gif","images/special_clk.gif");
//-->
</script>
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 :-
<script type="text/javascript">
<!--
Rollover("home", "images/home_off.gif", "images/home_on.gif", "images/home_clk.gif", "images/home_clk_off.gif");
Rollover("email", "images/email_off.gif", "images/email_on.gif", "images/email_clk.gif", "images/email_clk_off.gif");
Rollover("script", "images/script_off.gif", "images/script_on.gif", "images/script_clk.gif", "images/script_clk_off.gif");
Rollover("links", "images/links_off.gif", "images/links_on.gif", "images/links_clk.gif", "images/links_clk_off.gif");
Rollover("special","images/special_off.gif","images/special_on.gif","images/special_clk.gif","images/special_clk_off.gif");
//-->
</script>
Where the syntax is:
View 2 Replies
View Related
Aug 9, 2006
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:
View 5 Replies
View Related
Mar 25, 2007
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:
View 1 Replies
View Related
Jun 26, 2009
Is it possible to use image rollovers instead of the default text that comes with the plugin? [URL]
View 8 Replies
View Related
Aug 9, 2006
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:
View 12 Replies
View Related
Nov 3, 2009
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.
View 7 Replies
View Related
May 20, 2011
I have a button on the left, part way down that says "show/hide resume" How could I.
1) make the text read either "show" or "hide" when the button is clicked?
2) put a rollover effect on the button (simple text-shadow)
I've tried finding tutorials, but they are all for other types of buttons (submit, etc)Should I be using a different type of button?
View 5 Replies
View Related
Jan 19, 2011
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.
View 5 Replies
View Related
Jan 25, 2011
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.
<?php
View 2 Replies
View Related
Sep 17, 2007
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?
View 4 Replies
View Related
Jul 20, 2005
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.
MM_preloadImages(
'<%=assets_path%>/left_nav/manage_view_wthr_on.gif',
'<%=assets_path%>/left_nav/manage_admin_guide_on.gif',
'<%=assets_path%>/left_nav/manage_terms_cond_on.gif',
'<%=assets_path%>/left_nav/manage_reports_on.gif',
'<%=assets_path%>/left_nav/manage_account_info_on.gif',
)
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()");
eval(arguments[arg] + "_off.src = '" + ASSET_PATH_HEADER +
"button_nav_"+ arguments[arg] + "_off.gif'");
eval(arguments[arg] + "_on.src = '" + ASSET_PATH_HEADER +
"button_nav_"+ arguments[arg] + "_on.gif'");
eval(arguments[arg] + "_left.src = '" + ASSET_PATH_HEADER +
"button_nav_"+ arguments[arg] + "_left.gif'");
eval(arguments[arg] + "_right.src = '" + ASSET_PATH_HEADER +
"button_nav_"+ arguments[arg] + "_right.gif'");
}
// 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();
corner1.src = eval("'" + ASSET_PATH_HEADER +
"button_nav_corner_1.gif'");
corner2.src = eval("'" + ASSET_PATH_HEADER +
"button_nav_corner_2.gif'");
corner2_both.src = eval("'" + ASSET_PATH_HEADER +
"button_nav_corner2_both.gif'");
corner3.src = eval("'" + ASSET_PATH_HEADER +
"button_nav_corner_1.gif'");
corner3_both.src = eval("'" + ASSET_PATH_HEADER +
"button_nav_corner3_both.gif'");
corner4.src = eval("'" + ASSET_PATH_HEADER +
"button_nav_corner_1.gif'");
corner4_both.src = eval("'" + ASSET_PATH_HEADER +
"button_nav_corner4_both.gif'");
corner5.src = eval("'" + ASSET_PATH_HEADER +
"button_nav_corner_2.gif'");
}
}
View 2 Replies
View Related
Apr 21, 2005
Code:
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.
View 5 Replies
View Related
Apr 6, 2010
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.
View 10 Replies
View Related