SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to stop link opening in a new window

    When I click on a thumbnail the larger image appears in a new page. How do I stop it from doing that and making it open in the same page in a specified position.
    At the moment I can hover over a thumbnail and make the larger image appear nearby, but I'm stuck when it comes to clicking on a thumbnail.
    Any help will be greatly appreciated.

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by jackdaw59 View Post
    When I click on a thumbnail the larger image appears in a new page. How do I stop it from doing that and making it open in the same page in a specified position.
    At the moment I can hover over a thumbnail and make the larger image appear nearby, but I'm stuck when it comes to clicking on a thumbnail.
    Any help will be greatly appreciated.
    Are you talking about your own website, or a problem that happens in general when you're looking at other people's websites?

  3. #3
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,812
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Look check to see if your anchor tags' (links) target attributes are set to target="_blank", make sure it's NOT. hope that helps.

  4. #4
    SitePoint Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is happening in my own website, due to my lack of understanding of HTML, CSS etc.

  5. #5
    SitePoint Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dresden_phoenix

    I have checked that. No change no matter what it is set to or if it is omitted.

  6. #6
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by jackdaw59 View Post
    This is happening in my own website, due to my lack of understanding of HTML, CSS etc.
    We can rule out CSS because that won't be the culprit - it sounds like Javascript is more likely to be the problem. Give us a link to the site and we'll see if we can pinpoint where it is.

  7. #7
    SitePoint Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am still building my website so I cannot give you a link to it. I could copy a page from it if that would be of any use.

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,296
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by jackdaw59 View Post
    When I click on a thumbnail the larger image appears in a new page. How do I stop it from doing that and making it open in the same page in a specified position.
    It sounds like you just need to install a script for doing that. There are plenty of nice ones, like http://www.digitalia.be/software/slimbox2. See if that does what you want.

    If you want to keep the hover effect too, you might need some kind of custom script. There will also be some way to do this with CSS, but it's not going to work in all browsers.

  9. #9
    SitePoint Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ralph.m

    Thank you for telling me about that. It looks interesting. I shall investigate.


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
  •