1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how is page opened

Discussion in 'jQuery' started by mehr_83, Oct 4, 2013.

  1. #1
    Hi,
    I have a 2 page whit names: default1.aspx and default2.aspx
    for go to default2: in default1.aspx i use the fancybox and use this code:

    $("a#inline").fancybox({ 'hideOnContentClick': false , 'scrolling': 'no', 'titleShow': false, 'type': 'iframe', });
    goto default2
    when i click the "goto default2" the default2 shown as a pop up page.
    but when user right click on "goto default2" and select New Tab, The default2 opened in normal mode in new page.
    BUT:
    I want:
    if (default2.aspx opened bay fancybox) then default2.panel1.visible=false
    if (default2.aspx opened in normal mode) then default2.panel1.visible=true
    How i do?
    Please Help me,
     
    Solved! View solution.
    mehr_83, Oct 4, 2013 IP
  2. #2
    Well... You're trying to control a user's interaction with your webpage, which is never a good idea. You cannot control the user, so the best thing to do is creating a webpage that accomodates the user, no matter how stupid the user is.

    That being said, you could probably do something similar to this:
    On default2.aspx, you could have a jQuery-script run that checks if the content is loaded in a pop-up (iframe) or full window (probably, I'm just theorizing here) - and based on that, you could show or hide panel1. However, you need to understand that this won't really help - if the user choses to do it this way, s/he might also turn off javascript, and have to open the default2.aspx in another tab (the popup won't work without javascript running).

    However, you can make the panel1 visible by default, and chose to hide it with javascript if the user uses the regular, iframe way to show it - that will at least show the panel1 if the user is not using javascript, and when they chose to open it in another window/tab.
     
    PoPSiCLe, Oct 4, 2013 IP
  3. mehr_83

    mehr_83 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    thanks a lot,
     
    mehr_83, Oct 4, 2013 IP