quindi in teria potresti provare a fare(sempre che debba essere cosi')
Codice PHP:
$("#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 */
$('#hidden_myDiv').val(myDiv); //<input type="hidden" id="hidden_myDiv" value="" />
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
*/
$('#hidden_myDivNumA').val(myDivNumA); //<input type="hidden" id="hidden_myDivNumA" value="" />
})
$("#box1").click(function () {
//e qui poi...
var myDivNum = $('#hidden_myDiv').val();
var myDivNumA = $('#hidden_myDivNumA').val();
$('#content'+myDivNumA).hide('slow');
$('#graphic'+ myDivNum).hide();
$('#graphic'+ myDivNumA).show();
$('#box1').prepend($('#graphic'+myDivNumA));
$('#content'+ myDivNum).show('slow');
$('#block2').prepend($("#content1"));
return false;
});
});