I'm building a navigation that is built heavily on jQuery. I have it working as needed except that when mousing over links to quickly it spikes the processor and the navigation hangs. By hangs i mean it stops working and even the links will not show rollover states. I thought it was just a matter of adding a stop() but this changed nothing. Any ideas?
Here it is online http://sb.cesarvillaca.com/nav/nav.html
The code is below. -
-
<div id="ProductsNav-ov" style="display:none;"></div>
-
-
<div id="main-nav">
-
-
<ul>
-
<li class="mainnav-click" id="ProductsNav">PRODUCTS</li>
-
</ul>
-
-
<script type="text/javascript">
-
<!--
-
$(function() {
-
-
$('.mainnav-click').mouseenter(function() {
-
//alert($(this).attr('id'));
-
buildNav($(this).attr('id'));
-
});
-
-
});
-
-
function buildNav(nav,sub){
-
-
//alert(nav);
-
-
var Shredders = new Array({
-
Deskside: '',
-
Professional: '',
-
Commercial: '',
-
Government_Approved: '',
-
Supplies: ''
-
});
-
-
var Records_Storage = new Array({
-
Storage_Drawers: '',
-
Storage_Boxes: '',
-
Earth_Series: '',
-
Classroom_Organization: '',
-
Moving_Boxes: '',
-
Magazine_Holders: '',
-
Sorters: ''
-
});
-
-
var Workspace_Ergonomics = new Array({
-
Keyboard_Trays_and_Drawers: '',
-
Palm_and_Wrist_Supports: '',
-
Monitor_Supports: '',
-
Back_Supports: '',
-
Foot_Supports: '',
-
Copyholders: '',
-
Monitor_Filters: '',
-
Machine_Stands: ''
-
});
-
-
var Workspace_Organization = new Array({
-
Desk_Organizers: '',
-
Cubicle_Organizers: '',
-
Literature_Organizers: '',
-
Mail_Carts: ''
-
});
-
-
var Computer_Accessories = new Array({
-
Keyboards_and_Mice: '',
-
Mouse_Pads: '',
-
Cleaning_Supplies: '',
-
Power_Protection: '',
-
Keyguards: ''
-
});
-
-
var CD_DVD_Products = new Array({
-
Jewel_Cases_and_Inserts: '',
-
Desktop: ''
-
});
-
-
var Binding_Machines = new Array({
-
Plastic_Comb: '',
-
Wire: '',
-
Thermal: '',
-
Supplies: ''
-
});
-
-
var Laminating_Machines = new Array({
-
Personal: '',
-
General_Office: '',
-
Supplies: ''
-
});
-
-
var Cutters_and_Trimmers = new Array({
-
Cutters: '',
-
Rotary_Trimmers: '',
-
Supplies: ''
-
});
-
-
var Mobile_Accessories = new Array({
-
Mobile_Accessories: ''
-
});
-
-
var Refurbished_Shredders = new Array({
-
Refurbished_Shredders: ''
-
});
-
-
var Where_To_Buy = new Array({
-
Where_To_Buy: ''
-
});
-
-
var ProductsNav = {
-
"Shredders": Shredders,
-
"Records_Storage": Records_Storage,
-
"Workspace_Ergonomics": Workspace_Ergonomics,
-
"Workspace_Organization": Workspace_Organization,
-
"Computer_Accessories": Computer_Accessories,
-
"CD_DVD_Products": CD_DVD_Products,
-
"Binding_Machines": Binding_Machines,
-
"Laminating_Machines": Laminating_Machines,
-
"Cutters_and_Trimmers": Cutters_and_Trimmers,
-
"Mobile_Accessories": Mobile_Accessories,
-
"Refurbished_Shredders": Refurbished_Shredders,
-
"Where_To_Buy": Where_To_Buy
-
};
-
-
if (sub==undefined) {
-
-
var navPOP='';
-
navPOP+=
-
-
'<div id="drop-down-container">'+
-
'<div id="mainnav-title-ov">'+
-
'<div class="sprite main-nav-left lfloat"></div>'+
-
'<div class="main-nav-center auto-width">PRODUCTS</div>'+
-
'<div class="sprite main-nav-right lfloat"></div>'+
-
'<br class="clear">'+
-
'</div>'+
-
'<div id="drop-down" class="auto-width">'+
-
'<div id="mainnav-container" class="dots">'+
-
'<ul id="mainnav">';
-
-
var navname = "";
-
$.each(eval(nav), function(mainNav, mainNavobject) {
-
-
$.each(mainNavobject, function(i, subNavobject) {
-
-
$.each(subNavobject, function(property, value) {
-
-
if (navname != mainNav) {
-
-
navname = mainNav;
-
-
navPOP+= '<li><a href="' + value + '" class="subnav-click" id="' + mainNav + '">'+str_replace("_"," ",mainNav)+'</a></li>';
-
-
}
-
-
});
-
-
});
-
-
});
-
-
navPOP+=
-
-
'</ul>'+
-
'</div>'+
-
'<div id="drop-down-sub"></div>'+
-
'<br class="clear">'+
-
'</div>'+
-
'</div>';
-
-
var whatmenu = nav+'-ov';
-
-
$('#'+whatmenu).html(navPOP);
-
$('#mainnav-container').removeClass('dots');
-
-
$('#'+whatmenu).position({ my: "left top", at: "left top"});
-
-
$('#'+whatmenu).show();
-
-
}else{
-
-
//$("#drop-down-sub").stop();
-
-
$('#drop-down-sub').empty();
-
-
var navPOPsub='';
-
navPOPsub+= '<ul id="subnav">';
-
-
$.each(eval(nav), function(mainNav, subNavobject) {
-
-
$.each(subNavobject, function(property, value) {
-
-
navPOPsub+= '<li><a href="' + value + '">'+str_replace("_"," ",property)+'</a></li>';
-
-
});
-
-
});
-
-
navPOPsub+= '</ul>';
-
-
$('#mainnav-container').addClass('dots');
-
$('#drop-down-sub').html(navPOPsub);
-
$('#drop-down-sub').show();
-
}
-
-
$('.subnav-click').mouseover(function() {
-
buildNav($(this).attr('id'),1);
-
});
-
-
$('#drop-down-container').mouseleave(function() {
-
$('#ProductsNav-ov').hide();
-
});
-
-
}
-
//-->
-
</script>
-
-
</div>
-
-
</div>
-
0 1064 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Gale |
last post by:
I'm working on something in jQuery with XPath
What I want to do is: if checkbox is checked, set background color od
label that contain input(checkbox) to red
I have this code:...
|
by: ziobudda |
last post by:
Hi, I want ask you if, for a web portal/application, is better
prototype or Jquery? I don't want to innesc some type of flame, but
after the announce that drupal use JQuery and that the new...
|
by: DuaneMoraes |
last post by:
A new book on jQuery, the powerful JavaScript library, has been announced by Packt In Learning jQuery, Karl Swedberg and Jonathan Chaffer, creators of the popular jQuery learning resource...
|
by: mikeh3275 |
last post by:
I'm new to developing in jQuery, so I'm probably doing this wrong. I'm loading a form into a modal dialog box and I'm trying to assign a click event to the button in the form, but I can't seem to...
|
by: Aaron Gray |
last post by:
There does not seem too be anyway to test if two jQuery references are the
same element.
Given :-
... <div id="1"></div ....
Then :-
alert( $("#1") == $("#1"))
|
by: RobG |
last post by:
Do some of the regulars here need to re-think their (sometimes
strident) opposition to libraries? Both Microsoft and Nokia have
announced support for jQuery.
It seems to have gained quite a bit...
|
by: souporpower |
last post by:
Hi All
I am trying to print some HTML using JQUERY. I am posting the code. I
don't
see the alert. It seems as though the function is not registered when
the
document is loaded. Can someone...
|
by: souporpower |
last post by:
Hello All
I am trying to activate a link using Jquery. Here is my code;
<html>
<head>
<script type="text/javascript" src="../../resources/js/
jquery-1.2.6.js"</script>
<script...
|
by: jrod11 |
last post by:
hi,
I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
|
by: amskape |
last post by:
hi Friends,
I need to Upload some files in a Listing , by clicking
corresponding Upload link, then a popup window will
come with Browse option as Shown in attachment File.
My actual need is...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |