Results 1 to 6 of 6

Thread: html help please please

  1. #1
    Junior Member
    Join Date
    Mar 2002
    Posts
    13

    html help please please

    can anyone tell me how to open a small window as a webpage page loads, using just only html and no javascript! please help thanks!
    Welcome Yousefj32uk

  2. #2
    Thats impossible.... Maybe you cand o something with DHTML but its unlikely... Let me search and ill get back to you

    Ok, I got something for you.....

    Step 1: Add the following script into the <HEAD> section of your page:
    Code:
    <script>
    
    //DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
    //For full source code, documentation, and terms of usage,
    //Visit http://www.dynamicdrive.com/dynamici...htmlwindow.htm
    
    var dragapproved=false
    var minrestore=0
    var initialwidth,initialheight
    var ie5=document.all&&document.getElementById
    var ns6=document.getElementById&&!document.all
    
    function drag_drop(e){
    if (ie5&&dragapproved&&event.button==1){
    document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx
    document.getElementById("dwindow").style.top=tempy+event.clientY-offsety
    }
    else if (ns6&&dragapproved){
    document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx
    document.getElementById("dwindow").style.top=tempy+e.clientY-offsety
    }
    }
    
    function initializedrag(e){
    offsetx=ie5? event.clientX : e.clientX
    offsety=ie5? event.clientY : e.clientY
    if (ie5)
    document.getElementById("saver").style.display=''
    
    tempx=parseInt(document.getElementById("dwindow").style.left)
    tempy=parseInt(document.getElementById("dwindow").style.top)
    
    dragapproved=true
    document.onmousemove=drag_drop
    }
    
    function loadwindow(url,width,height){
    if (!ie5&&!ns6)
    window.open(url,"","width=width,height=height,scrollbars=1")
    else{
    document.getElementById("dwindow").style.display=''
    document.getElementById("dwindow").style.width=initialwidth=width
    document.getElementById("dwindow").style.height=initialheight=height
    document.getElementById("dwindow").style.left=30
    document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30 : document.body.scrollTop*1+30
    document.getElementById("cframe").src=url
    }
    }
    
    function maximize(){
    if (minrestore==0){
    minrestore=1 //maximize window
    document.getElementById("maxname").setAttribute("src","restore.gif")
    document.getElementById("dwindow").style.width=ns6? window.innerWidth-20 : document.body.clientWidth
    document.getElementById("dwindow").style.height=ns6? window.innerHeight-20 : document.body.clientHeight
    }
    else{
    minrestore=0 //restore window
    document.getElementById("maxname").setAttribute("src","max.gif")
    document.getElementById("dwindow").style.width=initialwidth
    document.getElementById("dwindow").style.height=initialheight
    }
    document.getElementById("dwindow").style.left=ns6? window.pageXOffset : document.body.scrollLeft
    document.getElementById("dwindow").style.top=ns6? window.pageYOffset : document.body.scrollTop
    }
    
    function closeit(){
    document.getElementById("dwindow").style.display="none"
    }
    
    if (ie5||ns6)
    document.onmouseup=new Function("dragapproved=false;document.onmousemove=null;document.getElementById('saver').style.display='none'")
    
    </script>
    Step 2: Add the below to the <BODY> section, preferably at the end of the page:
    Code:
    <div id="dwindow" style="position:absolute;background-color:navy;cursor:hand;left:0;top:0;display:none" onMousedown="initializedrag(event)" onSelectStart="return false">
    <div align="right">[img]max.gif[/img][img]close.gif[/img]</div>
    <iframe id="cframe" src="" width=100% height=100%></iframe>
    <div id="saver" style="width:100%;height:100%;position:absolute;left:0;top:0;display:none"></div>
    </div>
    
    <script>
    //Use below code to load DHTML Window as page loads 
    if (ns6) window.onload=new Function('loadwindow("http://www.geocities.com",600,400)')
    else
    loadwindow("http://www.geocities.com",600,400)
    </script>
    
    
    Geocities
    Thats the closest thing I could find.... It still uses JavaScript though

  3. #3
    Senior Member
    Join Date
    May 2002
    Posts
    390
    <A HREF="http://whatever you want" target="_blank">
    what you want them to read</A>

    or

    <A HREF="http://whatever you want" target="_blank">
    [img]here is my image.jpg[/img]
    </A>

    that SHOULD work for you...
    just like water off a duck\'s back... I AM HERE.

    for CMOS help, check out my CMOS tut?

  4. #4
    Senior Member roswell1329's Avatar
    Join Date
    Jan 2002
    Posts
    670
    qwerty_smith -- That's good code to open up a page in a separate browser window, but I think Yousefj32uk wanted something that would automatically open when you link to a separate page -- like a pop-up window. With javascript it would just be an onLoad call. With flat HTML -- it's not happening. DHTML will work, like ac1d said above, and perhaps XML (don't quote me on that, I don't know squat about XML).
    /* You are not expected to understand this. */

  5. #5
    hmmmm could be done with flash - that would require no java script

    just use the one frame load command

    v_Ln

  6. #6
    Well i don't think there is a direct way you can open a page(pop up)with naked HTML!
    you have to use one of these:
    FLASH
    JAVAscript
    DHTML
    there are other methods too but these are the most simple things you can use.
    among these FLASH and javascript seem to be better,because most browser support them.
    between FLASH and javascript FLASH is easer to handle.
    ----------------------------------------------------------------------------------------------------------------------
    As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they do not refer to reality. -- Albert Einstein

Posting Permissions

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