Jump to content
php.lv forumi
  • 0

javascript overlay


anonīms

Question

Problēma ir tur, ka uzspiežot uz linka vajadzētu būt overlay effektam, bet tāds nav. Kur varētu būt problēma?

 

html

<a id="sendpm" href="/lv/users/new_pm/311.html" onclick="return showbox(this.href,600,280);"> </a>

js

  function showbox(url,w,h){
 	var overlay = $('overlay');
 	var infobox = $('infobox');
 	var frame = $('boxframe');
 	var body = overlay.parentNode;
 	var ww = body.offsetWidth;
 	var wh = body.offsetHeight;
 	var bl = Math.round((ww-w)/2);
 	var fh = h-26;
 	frame.src=url;
 	frame.style.width=w+'px';
 	frame.style.height=fh+'px';
 	infobox.style.width=w+'px';
 	infobox.style.height=h+'px';
 	infobox.style.left=bl+'px';
 	overlay.style.width=ww+'px';
 	overlay.style.height=wh+'px';
 	overlay.style.display='block';
 	infobox.style.display='block';
 	return false;
 }

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Kaut kur baigi redzēta koda daļa :) Ja nemaldos, tad tur bija arī definēta funkcija: function $(id){ return document.getElementById(id); } nevis prototype ...

 

Pirms pāris gadiem konterstraikisti uzbruka, tikai nevienam no viņiem tā arī nebija izvedies to lapu iedarbināt (dzīvs piemērs šeit).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...