vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   html help:) (https://vborg.vbsupport.ru/showthread.php?t=69900)

AN-net 09-26-2004 10:07 PM

html help:)
 
ok well how would i make so when someone clicks a link that leads to a new window, that i can control its width:)

Xenon 09-26-2004 10:14 PM

to change the size of a window isn't doable with html alone iirc.

you have to use JavaScript for that, and so you'll get some which have disabled that ;)

Natch 09-27-2004 05:11 AM

There are 2 ways of creating and dealing with popups gracefully:

Simple.
Code:

a href="#" onclick="{mypopupcode}; return false"
The purpose of this is to stop the browser doing the Anchor-jump to the top of the page, looking for the blank a name="" anchor ('cos of a href="#").

Slightly more complex.
Code:

a href="mypopup.html" target="popup"  onclick="if(mypopup(this.href,this.target,popupsettings)) return false"
This one is based on [i]mypopup[/b] being a function you write, not relying on the window.open statement. The function "mypopup" will return NULL if the browser/screen reader/other web tool doesn't support the window.open facility and therfore open the popup page as it would normally do without the popup being there ... but if the function returns something, then the "return false" kicks in and stops the href doing its normal thing, while your pop up is popping away as you designed ...

[If the above looks like a canned response, it's cos I had it written months ago and it's an aticle on an old website of mine...]

So: if you create a javascript function to deal with your popups, have it return true if the popup works - that way you can determine if the javascript works and therefore return false to the regular browser behaviour and not load the link normally, but if the function refturns false, then your regular browser behaviour kicks in and your link still opens in a new window via the target="popup" HTML script.

AN-net 09-27-2004 10:56 PM

would it work like this?:
HTML Code:

<a href="popup.html" target="popup" onclick="window.open('popup.html', 'popup', 'height=200,width=200')">blah</a>

Modin 09-27-2004 11:12 PM

looks right to me AN-net, though just throw it in a test page and test it out :)

Natch 09-28-2004 12:35 AM

Quote:

Originally Posted by AN-net
would it work like this?:
HTML Code:

<a href="popup.html" target="popup" onclick="window.open('popup.html', 'popup', 'height=200,width=200')">blah</a>

HTML Code:

<a href="popup.html" target="popup" onclick="if(window.open(this.href, this.target, 'height=200,width=200')) return false">blah</a>
Try that: but yes the above would work too, you would just have the page behind change as well as popping up in a new window...

AN-net 09-28-2004 12:42 AM

kool thanks alot:)

now i need another thing, how do i make an action in one window affect another, like vb's attachment system. when you upload something it updates the post window and with the uploaded attachments, how would i achieve this?

Natch 09-28-2004 12:54 AM

Far more complex: now you are talking about the DOM and parent / child relationships...

How much knowledge do you have on Javascript?

AN-net 09-28-2004 02:12 AM

i would say fairly little....

Pitman 09-29-2004 01:28 PM

Quote:

Originally Posted by AN-net
kool thanks alot:)

now i need another thing, how do i make an action in one window affect another, like vb's attachment system. when you upload something it updates the post window and with the uploaded attachments, how would i achieve this?

I was wondering the same thing if anyone cares to shed some light on this :)


All times are GMT. The time now is 08:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01180 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete