closing javascript box

  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jan 16, 2004
  • Posts: 379
  • Loc: here
  • Status: Offline

Post February 2nd, 2004, 8:34 pm

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
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 2nd, 2004, 8:34 pm

  • RichB
  • Guru
  • Guru
  • User avatar
  • Joined: May 17, 2003
  • Posts: 1121
  • Loc: Boston
  • Status: Offline

Post February 3rd, 2004, 6:00 am

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
Free Programming Resources
  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jan 16, 2004
  • Posts: 379
  • Loc: here
  • Status: Offline

Post February 3rd, 2004, 10:47 am

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 194 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.