scusa marco ma non ti seguo moltissimo. sono proprio principiante in jquery.
ti faccio vedere il codice che ho usato:
ti mostro solo il codice per il tasto del box1.. gli altri sono solo copia incolla.
se uso i numeri anziche' le variabili tutto funziona alla perfezione.
Ps qui al lavoro non ci fanno installare nulla e usiamo ancora IE 7!!!!! (non ho nessun supporto da firebug)
posso guardare a casa con ff ma vorrei nella piu rosea delle mie aspettative farcela entro oggi..
se pensi che il mio codice sia sbagliato, potresti commentare il perche' e commentare il tuo codice per piacere? grazie ancora, mi stai dando una mano enorme!!!
Codice PHP:
// JavaScript Document
$(document).ready(function() {
$("#menu div").click(function() { /* if you click ONLY the element DIV whithin the div #container */
var myDiv = this.id; /* you get the ID of the div */
var myDivNum = myDiv.slice(-1); /* you get the last character of the ID of the div */
alert (myDivNum); /* if everything works you get an alert message */
})
$("#content div").click(function() { /* if you click ONLY the element DIV whithin the div #container */
var myDivA = this.id; /* you get the ID of the div */
var myDivNumA = myDivA.slice(-1); /* you get the last character of the ID of the div */
alert (myDivNumA); /* if everything works you get an alert message */
})
$("#graphic1").css({display: 'none'});
$("#graphic2").css({display: 'none'});
$("#graphic3").css({display: 'none'});
$("#graphic4").css({display: 'none'});
$("#graphic5").css({display: 'none'});
$("#content1").css({display: 'none'});
$("#content2").css({display: 'none'});
$("#content3").css({display: 'none'});
$("#content4").css({display: 'none'});
$("#content5").css({display: 'none'});
$(document).ready(function(){
$("#graphic1").css({display: ''});
$('#box1').prepend($("#graphic1"));
$("#graphic2").css({display: ''});
$('#box2').prepend($("#graphic2"));
$("#graphic3").css({display: ''});
$('#box3').prepend($("#graphic3"));
$("#graphic4").css({display: ''});
$('#box4').prepend($("#graphic4"));
$("#content5").show('slow');
$('#block2').prepend($("#content5"));
});
$("#box1").click(function () {
$('#content'+myDivNumA).hide('slow');
$('#graphic'+ myDivNum).hide();
$('#graphic'+ myDivNumA).show();
$('#box1').prepend($('#graphic'+myDivNumA));
$('#content'+ myDivNum).show('slow');
$('#block2').prepend($("#content1"));
return false;
});
});