Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-08-2016, 10:11 PM
ZiBoom's Avatar
ZiBoom ZiBoom is offline
 
Join Date: Sep 2015
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Pop ups

Whenever we link to a pop up page (say, youtube video), the thread jumps from the topic area where the pop up link resides to the main page. Is there any way to stop that? I apologize as I am a bit of a coding newbie.

I am using the latest version of VBB 5.
Reply With Quote
  #2  
Old 06-09-2016, 07:09 PM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do you link to a popup page?
Reply With Quote
  #3  
Old 06-10-2016, 04:56 AM
ZiBoom's Avatar
ZiBoom ZiBoom is offline
 
Join Date: Sep 2015
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry...I should have written this better.

I want a link to pop up in a separate window.

Thanks
Reply With Quote
  #4  
Old 06-10-2016, 09:42 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since you're not giving any detail - for example: how exactly are you triggering the popup? Code! - its hard to help.

Anyway - this is probably a javascript issue. You probably need to add "return false" to the code somewhere. There's plenty of examples around the net.
Reply With Quote
  #5  
Old 06-10-2016, 03:05 PM
ZiBoom's Avatar
ZiBoom ZiBoom is offline
 
Join Date: Sep 2015
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will give that a try. Thank you

Also, whilst I understand there are different examples, my problem was a bit more complicated. I am able to get the link to open up in another pop up window. However, the page where the link exists always bounces back to the main page.

Thanks
Reply With Quote
  #6  
Old 06-10-2016, 04:08 PM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You must be using something like this. You have to add return false to the onclick handler.

Code:
<a href="#" onclick="window.open('https://www.youtube.com/watch?v=NZYXNofi6zI', '_blank', 'width=400,height=300'); return false;">Watch</a>
But the better code is:

Code:
<a href="https://www.youtube.com/watch?v=NZYXNofi6zI" onclick="window.open(this.href, this.target, 'width=400,height=300'); return false;" target="_blank">Watch</a>
Reply With Quote
  #7  
Old 06-10-2016, 06:20 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ZiBoom View Post
I will give that a try. Thank you

Also, whilst I understand there are different examples, my problem was a bit more complicated. I am able to get the link to open up in another pop up window. However, the page where the link exists always bounces back to the main page.

Thanks
Yes. That's clear. But why do you keep that tiny bit of code from us that actually opens the popup? That's what's causing the error. Why should we guess if you could simply give us something to look at?
Reply With Quote
  #8  
Old 06-11-2016, 03:54 AM
ZiBoom's Avatar
ZiBoom ZiBoom is offline
 
Join Date: Sep 2015
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My apologies, but many thanks for your help as that was the trick.

I did not paste the entire code thread here because this is a separate computer from the one I use for coding. But here is the final solution. If I typo, forgive me...but this works on VBB 5

a href="" onclick="window.open('URL', 'TITLE, width=XXX,height=XXX'); return false;">
Reply With Quote
  #9  
Old 06-13-2016, 11:41 PM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That works. But as I mentioned in post #6, the better solution is to put the url in href. The reason is this still give users a choice to open the link in a new tab instead of the popup window by right-clicking the link and choosing 'Open link in new tab' option.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04065 seconds
  • Memory Usage 2,244KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete