Rollover Menu <div>
Dec 16, 2005
I've a highly customized site and therefore am attempting my own rollover menu function.
For right now I'll give the basics.
I have two divs - a left nav and a right content div.
The left div houses the left navigation and the right content div... well - houses the content.
On mouseover of a left navigation image - I am changing the image to "highlight" and also would like to display a previously hidden div that contains the submenu items.
That is all fine and dandy. My problem is this. When I mouseout of the image - I lose the highlighting and the displayed submenu.
I'm trying to figure out how to make a "handler" of some sort that will cause the image rollover to stay when I move the mouse to go select a menu item in the submenu.
There is probably 5-6 px between the right edge of the image and the right content div (which is where the submenu ends up displaying)...
Can I not catch the mouse position or something or am I limiting myself using the mouseover/mouseout functions or grr... How can I do this?
View 4 Replies
ADVERTISEMENT
May 6, 2010
How can I set the menu to automatically expand on mouse rollover instead of click? Here is the code as it stands right now:
$(document).ready(function () {
$('img.menu_class').click(function () {
$('ul.the_menu').slideToggle('medium');
});
});
Second Question: For some reason, the menu is appearing behind a table row when it expands, thus hiding a good portion of the menu. Here it is: [URL]
Try clicking on 'Products & Services', and then clicking on "Centerfire Rifle Suppressors" from the dropdown menu. When it takes you to that category page, click the menu again and you will see that the menu hides behind the <h1> table row.
View 2 Replies
View Related
May 18, 2009
I can't seem to figure out how to properly change my dropdown menu to work on rollover instead of on Click. When I change this to .hover I get a yo yo effect
sample:
http://www.creativemagma.com/whitney
<script type="text/javascript" src="scripts/js.js"></script>
[code]...
View 1 Replies
View Related
Apr 12, 2011
Im not sure my subject decsription gives an exact description of what i am after but i will try and explain my requirements a bit better.I have an header menu there are items in this menu but there are a lot of them and if you try view on a normal 1024 x 760 you have to horizontal scroll to view all the items, but on my monitor 1920 x 1080 it is fine.
I don't want to do it this way since I hate having to scoll both horizontal and vertical. I would like to be able to change the items on this header to become a rollover dropdown menu when they would normally be hidden becuase of the screen width. I have seen this done before I am just unsure about how to implement this.
View 3 Replies
View Related
Mar 7, 2006
Its cool but would like to have image rollovers instead of the text shown in the example.
I can't figure out how to do it without screwing up the slide bar on the bottom. And the css file won't let me specify which link like... a.home li {etc etc etc....I would really like to be able to have a separate rollover image for each link and have the slide bar work still.
View 2 Replies
View Related
May 8, 2009
I am trying to figure out whether or not there is an effective way to cut up the navigation on the right side of this banner so I can use the standard image swap. I am asking in this forum because I need to know if this will even work in the first place.
View 4 Replies
View Related
Nov 21, 2010
I tried to make a drop down menu with rollover image... with the drop down code that I found in this forum some days ago. I can finally make it but can't find how to make it rollover not hover with only colors. I want in like rollover menu but with drop down, but can't find how to make it rollover.
Javascript code
Code:
var timeout= 500;
var closetimer= 0;
var ddmenuitem= 0;
// open hidden layer
function mopen(id){
// cancel close timer
mcancelclosetime(); .....
View 1 Replies
View Related
Jul 14, 2009
I know very little about jQuery. I am trying to design a graphic menu bar that is capable of displaying each button in 4 modes: up (neutral), hover, down (mouse down), and selected. After some research, I was able to "come up" (by cutting and pasting and burning up a couple of neurons) with the code below. It works well enough but I'm sure it could be written a lot better. What I really would like to do is to change whatever button is "down" to go back "up" once another button is pushed, changing the img src, or by whatever method is more efficient.
<script src="js/jquery-1.3.2.js" type="text/javascript"
charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function() { // image rollover
$(".topmenu img").hover(function() {
this.src = this.src.replace("-up","-hover");
}, function() {
this.src = this.src.replace("-hover","-up"); .....
View 3 Replies
View Related
May 27, 2011
I've created a nav bar for this site - [URL].. I'm using javascript to handle the image rollover which is working just fine. However I want to add to this so that the current page will stay with the second or rollover image. How would you suggest I edit or add to my code so it keeps the second image active if it is the active page? In my script file this is what I'm using for an image:
menu1buttonup = new Image();
menu1buttonup.src = "http://web11.3essentials.com/~cp27358/wp-content/themes/origin/images/menu1.jpg" ;
menu1buttondown = new Image() ;
menu1buttondown.src = "http://web11.3essentials.com/~cp27358/wp-content/themes/origin/images/menu1a.jpg" ;
[Code]...
View 1 Replies
View Related
Sep 27, 2005
This is really only for anyone who has the book and has mastered the concepts of the rollover drop down menus from Chapter 7 in Stuart Langridge's DHTML Utopia book.
Does anyone know what the key is to getting the first menu list to appear inline, rather than as a block, while leaving everything else working as it does already?
View 3 Replies
View Related
May 26, 2011
I've created a nav bar for this site - [URL] - I'm using javascript to handle the image rollover which is working just fine. However I want to add to this so that the current page will stay with the second or rollover image. Do I edit or add to my code so it keeps the second image active if it is the active page?
In my script file this is what I'm using for an image:
menu1buttonup = new Image();
menu1buttonup.src = "[URL]" ;
menu1buttondown = new Image() ;
menu1buttondown.src = "[URL]" ;
Followed by....
function buttondown( buttonname ){
if (document.images) {
document[ buttonname ].src = eval( buttonname + "down.src" );
}} function buttonup ( buttonname ){
if (document.images) {
document[ buttonname ].src = eval( buttonname + "up.src" );
}}
And this is what my list items look like:
<a href="<?php echo home_url(); ?>/?page_id=7" onmouseover="buttondown('menu1button')"
onmouseout="buttonup('menu1button')"><img src="<?php bloginfo('template_url'); ?>/images/menu1.jpg" name="menu1button" /></a>
View 1 Replies
View Related
Oct 25, 2011
I'm building a WordPress site with a nice jQuery effect that fades/unfades images within a navigation menu on rollover. So when the mouse moves off the image, the colored image should fade back to reveal the original non-colored image. This works perfectly as-is, but client wants the active page to keep its colored/ highlighted menu image when mouse has moved off of it. The bolded line of the code is where I tried to set that up...
Code:
<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
<script type="text/javascript"><!-- this is from [URL]-->
// make nav images highlight on hover
// when the DOM is ready:
$(document).ready(function () {
// find the navigation elements and hook the hover event
$('#mainmenu li').hover(function() {
// on hovering over, find the element we want to fade *up*
var fade = $('> div', this);
// if the element is currently being animated (to a fadeOut)...
if (fade.is(':animated')) {
// ...take it's current opacity back up to 1
fade.stop().fadeTo(250, 1);
} else {
// fade in quickly
fade.fadeIn(250);
}}, function () {
// on hovering out, fade the element out
if (!is_page(current)){
var fade = $('> div', this);
if (fade.is(':animated')) {
fade.stop().fadeTo(3000, 0);
} else {
// fade away slowly
fade.fadeOut(2000);
}}});});
</script>
<ul id="mainmenu">
<li id="home">
<a href="/home"><img src="<?php bloginfo(url); ?>/wordpress/wp-content/uploads/2011/09/sara_inactive.png" alt="home" width="152" height="309" /></a>
<div>
<a href="/home"><img src="<?php bloginfo(url); ?>/wordpress/wp-content/uploads/2011/09/sara_active.png" alt="home" width="152" height="309" /></a>
</div>
</li>
WordPress should know whether the page is 'current' or not, so why doesn't this work? Currently the nav images remain highlighted when the mouse moves away. If I remove my attempt (the bolded line of code) then nav rollovers work beautifully, but active page still isn't represented with a colored nav menu image.
View 9 Replies
View Related
Oct 25, 2011
I have a situation where a context menu is being added to the DOM dynamically when a user right clicks on a control on the page. The div that gets added does not have an id set but the div does have a unique class. WhatI need to do is intercept the addition of the div and add a hover affect to some child nodes. Specifically any children that are <a> nodes. So far this is whatI have for adding the hover affect, but i'm not sure where it needs to go or howI link it to the event raised whan a new element is added to the dom.
$(
'div.context_menu_main').find('div a').hover(function() { $(this).addClass('context_menu_hover');
}, function() {
$(this).removeClass('context_menu_hover');
});
I have no control over the div itself as its part of a third party control soI am unable to add an id.
View 4 Replies
View Related
May 14, 2010
I have just started using Superfish. I am using a reverse color scheme (the background is green font color white) - so when I rollover a main menu item the menu item rolled over has a background of white, font color is green. When I go to a sub menu item the background of the main menu item stays white, but the font also stays white (I want the font to stay green).This is an example of how I want my menu to work:
http:[url]....
(Notice that when you rollover and then fly out, the main menu item rolled over maintains its background and foreground color).This is the part of the superfish.css that I have edited:
/*** DEMO SKIN ***/
.sf-menu
{[code].....
View 1 Replies
View Related
Jun 5, 2010
I have navigation buttons that I'll call primary buttons. I also have secondary navigation buttons that I'll call secondary buttons. If you rollover a primary navigation button, it should make secondary navigation buttons 1,4,and 5 go to rollover state A. However, if you rollover secondary navigation button 1,4 or 5 they should go to rollover state B.So the simplest way I can explain it is that the secondary navigation buttons need two rollover states possible.
View 2 Replies
View Related
May 11, 2010
Before, I had an iframe, and when I moused over a link outside the iframe, it would load a page into the iframe. Background image was part of the page loaded, as well as the text and what not. The problem was, the image took too long to load. I've been learning how to do javascript and I came across some code for preloading an image before the mouseover so there was zero wait time. For the past few days I've been trying to figure out how to have the preload image appear BENEATH the iframe (now with no background image or color) with the allowtransparency attribute set to true.
I've figured out the code to do both individually, i.e. I have the code so that when the link is moused over, the new image will appear; AND I have the code so that when the link is moused over, the page with load into the iframe. Both work, both do what is expected, but they don't do it together.Below is the script. Here's where it's confusing. If I have the "setupImgRollover..." first inside the if statement: the page loads into the iframe, but there is no image. If I have the "setupImgRollover..." after the "document.link..." commands in the if statement: the image appears but the page does not load into the iframe.
HTML Code:
window.onload = rolloverInit;
function rolloverInit() {
for (var i=0; i<document.links.length; i++) {
var linkObj = document.links[i];
[code]....
View 2 Replies
View Related
Apr 22, 2010
im trying to make the left Product Categories background position "rollover" menu work on this page: [URL] at the moment the page loads and CSS hover works to set the background position so that the graphic behind makes a roll over effect. i put some javascript to set the background position permantly to the roll over on click (so the user can see which one they are on) but then this knocks out the roll over effect on all other categories - it knocks out the CSS hover: onclick="setStyle('c1','backgroundPosition','0px 0px');
it means that c1:hover no longer works.. i tried putting !important in the CSS c1:hover background position and this fixed it in Firefox but not IE. So how can i write something in Javascript to also say: onclick="setStyle('c1:hover','backgroundPosition','-276px 0px');
i know Javascript does not do hyphens and the way to get for example "background-position" in CSS is to ditch the hyphen and make "P"osition capitol. perhaps something can be done also to get to the CSS hover attribute?
View 1 Replies
View Related
Feb 15, 2011
I have trouble with SuperFish Menu, of course it looks very nice and is good solution, but I am not advanced in CSS language.how to change space between menu and submenu in Navi-bar type menu? Now sobmenu hide part of menu, I have to must space.....
Attachments
superfis.JPG
Size : 11.4 KB
Download : 306
View 1 Replies
View Related
Jun 3, 2009
The problem is that the height of the second level menu results in their being gaps in between each menu item so that as you move your mouse down the second menu items it quickly closes again. scripting novice fix this by telling me which variable I need to change either in the Java script or the CSS files.
View 2 Replies
View Related
Nov 5, 2010
I have a mega menu that when the main menu items is hovered over the mega menu the div is displayed. I want to keep the div from being shown off the right of the browser screen. I have the following that determines the amount a div is off the right of the browser:
Code:
function keepMenuLeft(){
var div_width = $("li.hovering div").width();
[code]....
View 1 Replies
View Related
Feb 24, 2009
I'm working on a site and the main page has four images which has a rollover effect when you hover over it. However it only works for two images and the other two don't work.
View 1 Replies
View Related
Sep 21, 2004
I have a two navigations areas; top and side. I need when someone rollovers the top button it'll change image and also change the button on the right left menu.
So summing up it's 4 images. Two normal states and two rollover states. When you rollover one, both need to change to the rollover state.
View 1 Replies
View Related
Mar 28, 2001
I have a series of small pics that when you rollover, I would like them to be replaced with a new random one (and stay as the new image, until next rollover).
View 5 Replies
View Related
Oct 7, 2004
I seem to have a problem with rollovers. The problem is that in Firefox, when I roll over the button with my mouse, nothing happens (It's supposed to light up). When I roll over the button using IE, I get an error:
"A runtime error has occured.
Do you with to Debug?
Line 45
Error: Home_on_on is undefined"
And
"A runtime error has occured.
Do you with to Debug?
Line 63
Error: Home_off_off is undefined"
Home_on and Home_off are the file names I'm using for the rollover images.
I checked out the lines, and the lines are:
butOff = eval ( imgName + "_off.src" );
and
butOn = eval ( imgName + "_on.src" );
Now, I've tried everything, even tried copying the code from another sites with rollovers. No change.
I find this pretty frustrating, as I can't get my rollover buttons working because of this. Any way to fix this?
I'm using Dreamweaver MX2004 and this happens when I preview the site in my browser.
View 15 Replies
View Related
Apr 4, 2001
I have a gif which when 'rolled over' swaps with an animated gif. I want it to sit on the last frame of that animated gif, regardless of whether it is rolled over again or not.
In other words, I guess I only want the rollover to work once. Possible
View 1 Replies
View Related
Nov 18, 2004
I have a drop down menu which is a layer which overlaps another layer. Everything works perfectly in Internet Explorer, however, in Firefox and Netscape, the buttons flicker onMouseOut. I've messed about with the z-index, to no avail.
The code looks like this:
View 7 Replies
View Related