Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: DHTML Window widget (v1.1)

  1. #1
    Join Date
    Jan 2008
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default DHTML Window widget (v1.1)

    DHTML Window widget (v1.1)

    http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/


    Hi
    is it possible to make the scrolling and the resize be hidden on the iframe window, as it does on the div window.

    Thanks

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    To disable the scrollbars that show up within the IFRAME window, you would need to edit the <IFRAME> tag generated by the script directly for this. Inside the .js file:

    Code:
    t.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100%; height: 100%" scrolling="no" name="_iframe-'+t.id+'"></iframe>'
    The part in red is new, and would accomplish that.

    To disable resizing of the DHTML window, you would simply do this by setting resize=0 when calling dhtmlwindow.open():

    Code:
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://google.com", "Google Web site", "width=700px,height=450px,resize=0,scrolling=1,center=1", "recal")

  3. #3
    Join Date
    Jan 2008
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hi
    thanks for that but what i would idealy like is for there to be the scrowling and the resize on the frame when it first opens, then when the user clicks a link bellow it takes them to another page (preferably) and the frame does not have the scrowling or resize but is still positioned in the same place, can i do this with this? and how?
    Thanks

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    That's possible as well. Firstly, reverse the changes I had mentioned above then. Then, inside the first page opened by the DHTML window, add the function disablescroll() that should get called when a link is clicked on within that page that goes to another. For example, here is the full contents of what the 1st page may look like:

    Code:
    <script type="text/javascript">
    function disablescroll(){
    parent.googlewin.getElementsByTagName('iframe')[0].scrolling='no'
    parent.googlewin.isResize(false)
    }
    </script>
    
    <a href="test2.htm" onClick="disablescroll()">Go to another page</a>
    
    <div style="height: 800px"></div>
    When the user clicks the link to go to "test2.htm", the DHTML window will have its scrolling/resize disabled.

    Important: "googlewin" should match the variable you assigned when calling dhtmlwindow.open() on your main page, for example:

    Code:
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "test.htm", "#1: Google Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")

  5. #5
    Join Date
    Jan 2008
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    when i click the link it goes says no file exists, i have another idea but i don't know if it is possible so when the user has positioned the frame and resized it they click a link bellow and the positioning and the size are then saved in a users account and so that they can be opened again. Is this possible? and how would i do this? i think it would involve mysql is there another way?
    Thanks

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Well, the link inside test.htm points to test2.htm, so make sure both pages are defined:

    Code:
    <a href="test2.htm" onClick="disablescroll()">Go to another page</a>

  7. #7
    Join Date
    Jan 2008
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hi
    thanks for your help that now works, also is my other suggestion about saving it above possible? and how?

    Thanks

  8. #8
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Quote Originally Posted by ojsimon View Post
    hi
    i have another idea but i don't know if it is possible so when the user has positioned the frame and resized it they click a link bellow and the positioning and the size are then saved in a users account and so that they can be opened again. Is this possible? and how would i do this? i think it would involve mysql is there another way?
    Thanks
    In general there are two ways to do this, either by using JavaScript cookies, or saving the info on the server end, whether inside a text file or database. If you're talking about an existing database that stores your users account info, then it requires extending those scripts to store this additional info. Either way though, it's highly dependent on how things are set up on your site, and there's no plug and play solution I can offer.

  9. #9
    Join Date
    Jan 2008
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that, also how would i output the settings and position if possible as a string.


    Thanks

  10. #10
    Join Date
    Jan 2008
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Please can someone help me output the settings as a string so that they can be saved

    Thanks

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
  •