anonīms Posted June 2, 2011 Report Posted June 2, 2011 Kā panākt, ka noteikts div's parādas tieši tur, kur nospiesta pele? (pašlaik ir statisks margins), bet nepieciešams, lai teiksim diva kreisais stūris ir pie peles. offset? Quote
0 Grey_Wolf Posted June 2, 2011 Report Posted June 2, 2011 (edited) elementari 1. noskaidro peles poziciju, pamekle google simtiem risinajumu. 2. novieto konkreto divu vajadzigaja pozicija (ar apsaluto pozicioneshanu ) Edited June 2, 2011 by Grey_Wolf Quote
0 codez Posted June 2, 2011 Report Posted June 2, 2011 http://jsfiddle.net/7pBkx/ JS: $(function(){ $(document).click(function(e){ $('<div class="rect">') .css({top:e.pageY,left:e.pageX}) .appendTo('body'); }); }); CSS: .rect{ position:absolute; width:20px; height:20px; border:1px solid #888; background:#afa; } Quote
Question
anonīms
Kā panākt, ka noteikts div's parādas tieši tur, kur nospiesta pele? (pašlaik ir statisks margins), bet nepieciešams, lai teiksim diva kreisais stūris ir pie peles.
offset?
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.