Results 1 to 5 of 5

Thread: DHTML Modal Hide Drag Bar

  1. #1
    Join Date
    Jun 2008
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Exclamation DHTML Modal Hide Drag Bar

    1) Script Title:
    DHTML Modal
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...dhtmlmodal.htm
    3) Describe problem:
    This script is absolutely one of the best modal scripts I have seen, but there is one thing that is very important, and this would also solve a few of the other questions I've searched and seen. I am wondering if someone could help me disable the top bar (drag bar) completely.

    ,dragbar=1, or ,dragbar=0 (example variable, default to 1 - on) - My reason isn't to disable the drag, but a few others have wanted this - my reason is to pop-up messages that require an answer, without the ability to close, minimize, or move the dialog box.

    I am more than willing to donate alittle money to dynamic drive for this addition, or to someone else for that matter

    Thanks in advance,
    Chris
    Last edited by JustBittin; 06-27-2008 at 05:50 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In the stylesheet, just add (highlighted):

    Code:
    .drag-handle{ /*CSS for Drag Handle*/
    padding: 1px;
    text-indent: 3px;
    font: bold 14px Arial;
    background-color: #CA0000;
    color: white;
    cursor: move;
    overflow: hidden;
    width: auto;
    filter:progid:DXImageTransform.Microsoft.alpha(opacity=100);
    -moz-opacity: 1;
    opacity: 1;
    display:none;
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    JustBittin (06-27-2008)

  4. #3
    Join Date
    Jun 2008
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    This I understand - I think I wasn't clear - I use the modal box for other things to, different about us sections, terms, etc.. so I don't ALWAYS want the drag-bar disabled, just on call for certain boxes... on the same page the drag-bar may or may not need to be visible... this is my dilemma...

    Thanks again...
    Chris

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That can be done as well using the css style. Each modal has a unique id configured for it when it is setup (example from the source code of the demo page):

    Code:
    <script type="text/javascript">
    
    var agreewin=dhtmlmodal.open("agreebox", "iframe", "modalfiles/agreement.htm", "This Page's Terms of service", "width=590px,height=450px,center=1,resize=1,scrolling=0", "recal")
    
    agreewin.onclose=function(){ //Define custom code to run when window is closed
    	var theform=this.contentDoc.getElementById("eula") //Access form with id="eula" inside iframe
    	var yesbox=theform.eulabox[0] //Access the first radio button within form
    	var nobox=theform.eulabox[1] //Access the second radio button within form
    	if (yesbox.checked==true)
    		alert("You agreed to the terms")
    	else if (nobox.checked==true)
    		alert("You didn't agree to the terms")
    	return true //Allow closing of window in both cases
    }
    
    </script>
    So, if you only want to remove that particular modal's dragbar, add this to your stylesheet:

    Code:
    #agreebox .drag-handle {
    display:none;
    }
    It will only knock out the one for that modal.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    JustBittin (06-27-2008)

  7. #5
    Join Date
    Jun 2008
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Such a simple way - Sometimes as a programmer we forget the easy ways... it's crazy, I was in the middle of writing a javascript function to change the class display property.

    Man, did I tell you that your my hero today

    Thanks greatly, worked perfect.

    Chris

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •