closing javascript box

  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

I've found a script at dynamic drive that fits exactly what i would like to do, but for some reason the script isn't working correctly. the close function is not . . . well, functional :lol:

here's what seems to be the important portion of the code
Code: [ Select ]
<td id="dragbar" style="cursor:hand; cursor:pointer" width="100%" onMousedown="initializedrag(event)"><ilayer width="100%" onSelectStart="return false"><layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onMouseout="dragswitch=0"><font face="Verdana"
    color="#FFFFFF"><strong><small>Announcement Box</small></strong></font></layer></ilayer></td>
    <td style="cursor:hand"><a href="#" onClick="hidebox();return false"><img src="close.gif" width="16px"
    height="14px" border=0></a></td>
  1. <td id="dragbar" style="cursor:hand; cursor:pointer" width="100%" onMousedown="initializedrag(event)"><ilayer width="100%" onSelectStart="return false"><layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onMouseout="dragswitch=0"><font face="Verdana"
  2.     color="#FFFFFF"><strong><small>Announcement Box</small></strong></font></layer></ilayer></td>
  3.     <td style="cursor:hand"><a href="#" onClick="hidebox();return false"><img src="close.gif" width="16px"
  4.     height="14px" border=0></a></td>


the link for the whole script is http://www.dynamicdrive.com/dynamicindex11/abox.htm#

I've tried changing the onClick attribute from "hidebox" to "window.close", but that causes the entire web page to close (not quite what I expected or wanted.)

Mark
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

Strange. If you move the box around and then click to close it everything works fine, but if you close it without dragging it you get an error because the objects haven't been intialized yet.

I'd suggest getting a better script that does the same thing. Bigwebmaster has one linked form his other site:

http://www.bigwebmaster.com/1017.html
  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

RichB wrote:
Strange. If you move the box around and then click to close it everything works fine, but if you close it without dragging it you get an error because the objects haven't been intialized yet.

I'd suggest getting a better script that does the same thing. Bigwebmaster has one linked form his other site:

http://www.bigwebmaster.com/1017.html


wow, i hadn't even noticed that. i just automatically tried to close it without moving it (which i think most users would, as well.) that is a strange behavior.

great link, BTW. i was kind of dissapointed because all of the message boxes i had seen were based on some sort of pop up window or something along those lines. i really liked the "clickable layer" idea. thanks for the link!

mark

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 113 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.