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

Thread: Question about resizing, removing scrollbar...

  1. #1
    Join Date
    Sep 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Question about resizing, removing scrollbar...

    Hello,

    Well, I have a problem and hope every PRO Javascript can help me to solve this out.

    On my site, I want the page below:
    http://www.vm-source.com/vm-music/myWimpy.php

    I want the window to resize itself when you enter (which it's already done), but I would like that people cannot resize the window, cannot scrolling the page and I want to disable the Address Bar and all other Toolbar...

    I don't want to use Javascript URL (popup, I mean)

    All I want: People enter to the page, the page will stretch, and there will be no tollbar, scrollbar... Only the TitleBar is allowed..

    It is possible?

  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

    Can't be done without a pop-up except the bit about the scrollbar. The pop-up would have to be coded on the page that contains a link to this page. I'm not sure why you don't want a pop-up, it is actually superior (to resizing onload) for this if launched directly from a link, because browsers that do not allow javascript to resize an open window will allow initial opening of a window to a specific size.

    To disable the scrollbars:

    <body style="overflow:hidden;">

    Why exactly don't you want a pop-up?
    Last edited by jscheuer1; 09-29-2005 at 08:26 AM.
    - John
    ________________________

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

  3. #3
    Join Date
    Sep 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK.. I will tell you why...

    I have a forum just like this one.. VBulletin..

    I have try to insert an javascript link on the forum, but it doesn't work..
    Well, I have enable the HTML, but it doesn't work too..

    That it why I don't want popup.. Or can you find a solution that we can insert an javalink on a such forum, in a post...

    Suppose: On my site, I tell people to "Click Here" in order to view a pic..and I want to popup it.. but with the javascript, it doesn't work..

    Can I use this:
    <script language="JavaScript1.2">
    <!--

    //Open offsite links in new window option- By Jessica Hammer
    //Heavily modified by Dynamic Drive
    //Visit http://www.dynamicdrive.com for this script

    //1)Enter domains to be EXCLUDED from opening in new window:
    var excludedomains=["dynamicdrive.com", "javascriptkit.com"]

    //2)Automatically open offsite links in new window? (1=yes, 0 will render a checkbox for manual selection)
    var auto=1

    var excludedomains=excludedomains.join("|")
    rexcludedomains=new RegExp(excludedomains, "i")

    if (!auto)
    document.write('<form name="targetmain"><input type="checkbox" name="targetnew" checked onClick="dynamiclink()">Open off-site links in new window</form>')

    function dynamiclink(){

    if (auto||(!auto&&document.targetmain.targetnew.checked)){
    for (i=0; i<=(document.links.length-1); i++) {
    if (document.links[i].hostname.search(rexcludedomains)==-1&&document.links[i].href.indexOf("http:")!=-1)
    document.links[i].target="_blank"
    }
    }
    else
    for (i=0; i<=(document.links.length-1); i++) {
    if (document.links[i].hostname.indexOf(mydomain)==-1)
    document.links[i].target=""
    }
    }

    if (auto)
    window.onload=dynamiclink

    // -->
    </script>

    <p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
    <a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
    But if you can add more option, so the new window won't have the toolbar and scrollbar...

  4. #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

    Hmm, the forums resist javascript links for a good reason but if this is your own forum you can try:

    Code:
    function dynamiclink(){
    
    if (auto||(!auto&&document.targetmain.targetnew.checked)){
    for (i=0; i<=(document.links.length-1); i++) {
    if (document.links[i].hostname.search(rexcludedomains)==-1&&document.links[i].href.indexOf("http:")!=-1)
    document.links[i].onclick=function(){
    window.open(this.href,'','width=495,height=190,resizable=0')
    return false;
    }
    }
    else
    for (i=0; i<=(document.links.length-1); i++) {
    if (document.links[i].hostname.indexOf(mydomain)==-1)
    document.links[i].target=""
    }
    }
    - John
    ________________________

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

  5. #5
    Join Date
    Sep 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    THANK YOU VERY MUCH!!! IT WORKS....
    Last edited by hktvb2001; 09-29-2005 at 05:13 PM.

  6. #6
    Join Date
    Sep 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OUPS!! I forgot something..

    The popup that appears is located in my site.. but the script open a new window on an offlink site.. What do I have to do, if I want a html file on a folder to be open in a new window?

    my site: www.vm-source.com
    the file that I want to be opened: www.vm-source.com/index.php

    If I use this script, then it won't open in a new window, because the index.php is locate is www.vm-source.com

    How do I make on the script that it let the index.php open, but all link in my site.. www.vm-source.com stay as it..mean it don't open in a new window..

  7. #7
    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

    Well, I'm not sure I understand the specific objective here. Also, I cannot 'play' with this one because it involves a forum which I don't have at my disposal. However, it seems that you just need a way of identifying those links that you wish to apply this effect to. So, how many links do you want to have open in a new window? What, if anything, is special about them as far as their url's go? It doesn't have to be the domain, as you suggest, it could be a folder but you haven't supplied a folder name so I'm not sure this is what you have in mind. Let's use a folder though if possible. This would mean putting all onsite pages that you want to have receive this special treatment in a special folder say, new_wins, for example:
    Code:
    www.vm-source.com/new_wins/
    or we could use the existing directory:
    Code:
    www.vm-source.com/vm-music/
    Then in the script change:
    Code:
    if (document.links[i].hostname.search(rexcludedomains)==-1&&document.links[i].href.indexOf("http:")!=-1)
    to:
    Code:
    if (document.links[i].indexOf('vm-music')!==-1&&document.links[i].href.indexOf("http:")==-1)
    This will work for files in the vm-music folder if the forum does not automatically add the the absolute path to links, if it does, you can go with:
    Code:
    if (document.links[i].indexOf('vm-music')!==-1&&document.links[i].href.indexOf("vm-source.com")!==-1)
    - John
    ________________________

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

  8. #8
    Join Date
    Sep 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK.. Now it doesn't work..

    Here's the script I insert in my page:
    <script language="JavaScript1.2">
    <!--
    function dynamiclink(){
    if (auto||(!auto&&document.targetmain.targetnew.checked)){
    for (i=0; i<=(document.links.length-1); i++) {
    if (document.links[i].indexOf('vm-music')!==-1&&document.links[i].href.indexOf("vm-source.com")!==-1)
    document.links[i].onclick=function(){
    window.open(this.href,'','width=495,height=190,resizable=0')
    return false;
    }
    }
    }
    else
    for (i=0; i<=(document.links.length-1); i++) {
    if (document.links[i].hostname.indexOf(mydomain)==-1)
    document.links[i].target=""
    }
    }

    if (auto)
    window.onload=dynamiclink
    // -->
    </script>
    Does that mean that all file in the folder "vm-music" will be opened in a new window with the no-resize option? and all file in vm-source.com will not open in new window?

    Well, it doesn't work.. The script which work before was this:

    <script language="JavaScript1.2">
    <!--

    //Open offsite links in new window option- By Jessica Hammer
    //Heavily modified by Dynamic Drive
    //Visit http://www.dynamicdrive.com for this script

    //1)Enter domains to be EXCLUDED from opening in new window:
    var excludedomains=["vm-source.com"]

    //2)Automatically open offsite links in new window? (1=yes, 0 will render a checkbox for manual selection)
    var auto=1

    var excludedomains=excludedomains.join("|")
    rexcludedomains=new RegExp(excludedomains, "i")

    if (!auto)
    document.write('<form name="targetmain"><input type="checkbox" name="targetnew" checked onClick="dynamiclink()">Open off-site links in new window</form>')

    function dynamiclink(){

    if (auto||(!auto&&document.targetmain.targetnew.checked)){
    for (i=0; i<=(document.links.length-1); i++) {
    if (document.links[i].hostname.search(rexcludedomains)==-1&&document.links[i].href.indexOf("http:")!=-1)
    document.links[i].onclick=function(){
    window.open(this.href,'','width=495,height=190,resizable=0')
    return false;
    }
    }
    }
    else
    for (i=0; i<=(document.links.length-1); i++) {
    if (document.links[i].hostname.indexOf(mydomain)==-1)
    document.links[i].target=""
    }
    }

    if (auto)
    window.onload=dynamiclink


    // -->
    </script>
    Now, can you give me the whole new edit script which work for my request?

  9. #9
    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

    I left out the red part:
    Code:
    if (document.links[i].href.indexOf('vm-music')!==-1&&document.links[i].href.indexOf("vm-source.com")!==-1)
    That's the trouble with not being able to play with it on the page. Anyways, the script (if I now have the above conditional correct) should be able to be cut down to:
    Code:
    <script type="text/javascript">
    <!--
    function dynamiclink(){
    for (var i=0; i<(document.links.length); i++)
    if (document.links[i].href.indexOf('vm-source.com/vm-music')!==-1)
    document.links[i].onclick=function(){
    window.open(this.href,'','width=495,height=190,resizable=0')
    return false;
    }
    }
    
    window.onload=dynamiclink;
    // -->
    </script>
    - John
    ________________________

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

  10. #10
    Join Date
    Sep 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well,

    Thank you many and many TIMES... You are so great.. Thanks for your help.. It was so helpfull.. Thanks again...

    Also, If I want to have more than vm-music folder, what do I have to put in?
    Is that right?
    <script type="text/javascript">
    <!--
    function dynamiclink(){
    for (var i=0; i<(document.links.length); i++)
    if (document.links[i].href.indexOf('vm-source.com/vm-music','vm-source.com/anotherfolder')!==-1)
    document.links[i].onclick=function(){
    window.open(this.href,'','width=495,height=190,resizable=0')
    return false;
    }
    }

    window.onload=dynamiclink;
    // -->
    </script>
    Also, maybe you gonna think that I'm StuP*d... But can I remove the STATUS bar also?? hi hi.. it is? status=no or status=0??

    THANKS AGAIN..
    Last edited by hktvb2001; 09-30-2005 at 07:36 AM.

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
  •