SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    May 2001
    Location
    hong kong
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    page size control

    <A HREF="http://mysite.com" target="_blank">mysite</A>
    Above quote display the page of my site when click..but it show a page with full screen...
    So anyone can tell me how to show up only a medium size of page on the fly say, width=150 height=150..that would not covered the current page I am just viewing....

    Thanks...

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <script>
    function pop(url){
      popup=window.open(url,'','width=150,height=150');
    }
    </script>
    
    <a href="#" onclick="pop('http://mysite.com');">mysite</a>

  3. #3
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation accessibility / non javascript browsers

    to make this work for browsers without javascript as well (sorry, i'm thinking accessibility here...lynx etc don't have javascript) i suggest a change to randem's code
    Code:
    <script>
    function pop(url){
      popup=window.open(url,'','width=150,height=150');
    }
    </script>
    
    <a href="http://mysite.com" onclick="pop('http://mysite.com');return false;" target="_blank">mysite</a>
    the nifty part is the "return false". for browsers with javascript, the pop function will pop up the window and the return false will prevent the browser from "normally" processing the href of the link. for browsers without javascript (or with JS disabled), the onclick behaviour will be ignored and the link processed as normal (without control over the size of the window, but at least it works and is accessible)
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  4. #4
    SitePoint Addict
    Join Date
    May 2001
    Location
    hong kong
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks redem...
    Is there no other ways without use of js????

  5. #5
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope.


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
  •