Just a quick question that I can’t understand, I hope that you guys and girls will help you.
I have div(with an identifier) that opens a new one when clicked div- it works fine, I really want to "fill" the new one with divpredefined text based on the clicked div identifier, Example:
<div class="infobox" id="help_msg1">Click me</div>
I can say 3 (actually more ......) of these divs
This will open:
<div id="helpbox">text in here</div>
In / on my page .js, I have doc ready, etc., then:
var help_msg1 = 'text, which is a help message'; var help_msg2 = 'text, which is another help message'; var help_msg3 = 'text, which is another help message';
Then
$('.infobox').live('click',function() {
$('#helpbox').remove();
$('label').css({'font-weight': '400'});
$(this).next('label').css({'font-weight': '900'});
var offset = $(this).next().next().offset();
var offsetby = $(this).next().next().width();
var leftitby = offset.left+offsetby+10;
$('body'). append (' ');
$ ('# helpbox'). css ({'left': leftitby, 'top': offset.top});
});
. #helpbox , .next().next() , .
, var help_msg1 append id="help_msg1" var help_msg2 id="help_msg2" ..