Visualizzazione dei risultati da 1 a 3 su 3

Discussione: problema menu

  1. #1

    problema menu

    Ciao Ragazzi,

    ho questo menu...

    http://www.cvgmoda.com/newsite/gallery1/menu/


    come posso fare in modo di selezionare la voce 2 - 3 e non home come da default?

    Grazie, ciao.
    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

  2. #2
    codice:
    <script type="text/javascript">
    			$(function() {
    				Cufon.replace('a, span').CSS.ready(function() {
    					var $menu 		= $("#slidingMenu");
    					
    					/**
    					* the first item in the menu, 
    					* which is selected by default
    					*/
    					var $selected	= $menu.find('li:first');
    					
    					/**
    					* this is the absolute element,
    					* that is going to move across the menu items
    					* it has the width of the selected item
    					* and the top is the distance from the item to the top
    					*/
    					var $moving		= $('<li />',{
    						className	: 'move',
    						top			: $selected[0].offsetTop + 'px',
    						width		: $selected[0].offsetWidth + 'px'
    					});
    					
    					/**
    					* each sliding div (descriptions) will have the same top
    					* as the corresponding item in the menu
    					*/
    					$('#slidingMenuDesc > div').each(function(i){
    						var $this = $(this);
    						$this.css('top',$menu.find('li:nth-child('+parseInt(i+2)+')')[0].offsetTop + 'px');
    					});
    					
    					/**
    					* append the absolute div to the menu;
    					* when we mouse out from the menu 
    					* the absolute div moves to the top (like innitially);
    					* when hovering the items of the menu, we move it to its position 
    					*/
    					$menu.bind('mouseleave',function(){
    							moveTo($selected,400);
    						  })
    						 .append($moving)
    						 .find('li')
    						 .not('.move')
    						 .bind('mouseenter',function(){
    							var $this = $(this);
    							var offsetLeft = $this.offset().left - 20;
    							//slide in the description
    							$('#slidingMenuDesc > div:nth-child('+ parseInt($this.index()) +')').stop(true).animate({'width':offsetLeft+'px'},400, 'easeOutExpo');
    							//move the absolute div to this item
    							moveTo($this,400);
    						  })
    						  .bind('mouseleave',function(){
    							var $this = $(this);
    							var offsetLeft = $this.offset().left - 20;
    							//slide out the description
    							$('#slidingMenuDesc > div:nth-child('+ parseInt($this.index()) +')').stop(true).animate({'width':'0px'},400, 'easeOutExpo');
    						  });;
    					
    					/**
    					* moves the absolute div, 
    					* with a certain speed, 
    					* to the position of $elem
    					*/
    					function moveTo($elem,speed){
    						$moving.stop(true).animate({
    							top		: $elem[0].offsetTop + 'px',
    							width	: $elem[0].offsetWidth + 'px'
    						}, speed, 'easeOutExpo');
    					}
    				}) ;
    			});
    		</script>

    Penso che il punto incriminato sia questo:

    /**
    * the first item in the menu,
    * which is selected by default
    */
    var $selected = $menu.find('li:first');

    Come posso selezionare il secondo li ???
    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

  3. #3
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    Originariamente inviato da enigma_79

    var $selected = $menu.find('li:first');

    Come posso selezionare il secondo li ???
    var $selected = $menu.find('li').eq(1);

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.