Home › Forum › Problemi Vari con WP › WordPress jquery
-
AutorePost
-
-
9 Febbraio 2011 alle 17:00 #16713albyy911Partecipante
come si inserisce un effetto jquery in wordpress??
ho provato in vari modi ma non riesco ancora c’è una wiki che mi spiega come fare??
il sito in questione è questo : http://lnx.dvslab.it/wordpress
Grazie
-
9 Febbraio 2011 alle 17:47 #81162SteveAglAmministratore del forum
effetto quale dove come ? Noi la sfera di cristallo ò’abbiamo rotta da tempo… poi la cosa presuppone tu sappia di javascript html e magari anche css
-
9 Febbraio 2011 alle 18:06 #81164albyy911Partecipante
scusa se sono stato poco preciso.
ho fatto l’effetto in jquery, telo descrivo:
se passo sopra ad un elemento del menu a quest’ultimo compare da sotto una linguetta.
Questo è il codice Css utilizzato:
#menu ul {
list-style:none;
margin:0;
padding:0;
}
#menu li {
float:left;
width:200px;
margin:0;
padding:0;
text-align:center;
}
#menu li a {
display:block;
padding:10px 10px;
height:100%;
color:#000;
text-decoration:none;
border-right:1px solid #FFF;
}
#menu li a {
background:url(http://lnx.dvslab.it/wordpress/wp-content/themes/tutorial_theme/images/mt.jpg) repeat 0 0;
}
#menu li a:hover, li a:focus, li a:active {
background-position:-100px 0;
}
#menu a {
background:url(http://lnx.dvslab.it/wordpress/wp-content/themes/tutorial_theme/images/mt.jpg) repeat 0 0;
}
questo invece è il codice jquery utilizzato:
jQuery(function(){
jQuery(‘#menu ul li a’)
.css( {backgroundPosition: “0 0”} )
.mouseover(function(){
jQuery(this).stop().animate({backgroundPosition:”(0 -80px)”}, {duration:200})
})
.mouseout(function(){
jQuery(this).stop().animate({backgroundPosition:”(0 0)”}, {duration:200})
})
});
questa invece è la parte html in cui si dovrebbe applicare l’effeto:
<div id=”menu”>
-
<li class=”page_item page-item-72 current_page_item”>Home
<li class=”page_item page-item-14″>Portfolio
<li class=”page_item page-item-16″>What I Do
<li class=”page_item page-item-11″>Contatti
</div>
Ora, la librerie jquery sono 2:
http://lnx.dvslab.it/wordpress/wp-content/themes/tutorial_theme/jquery-1.2.6.min.js
http://lnx.dvslab.it/wordpress/wp-content/themes/tutorial_theme/jquery.bgPos.js
l’unico problema è che se lo faccio in locale funziona ma se lo monto su wordpress no…
se ti serve ti passo il file in cui testo il jquery…
dimmi pure se non capisci e/o hai bisogno di più tettagli
Ps: se ci fai caso quando passi sopra un elemento del menu lo sfondo si muove leggermente ma non riesco a capire l’errore.
-
9 Febbraio 2011 alle 18:15 #81165albyy911Partecipante
scusa ma ti ho scritto male il codice html.
non risco a capire come scriverti il codice html.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.