Author |
Topic |
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 25 July 2002 : 00:43:17
|
In v 3.4 Is it still set to open up new windows using 5 functions? If so, why not just make it one function?
example using one function for all popups
function openWindow(url, height, width, resizable, scrollbars) { popupWin = window.open(url,'page','height='+height+',width='+width+',resizable='+resizable+',scrollbars='+scrollbars+'') }
Brad Web Hosting with SQL Server @ $24.95 per month
|
|
Spoon
Average Member
Ireland
507 Posts |
Posted - 25 July 2002 : 18:42:52
|
quote:
In v 3.4 Is it still set to open up new windows using 5 functions? If so, why not just make it one function?
example using one function for all popups
function openWindow(url, height, width, resizable, scrollbars) { popupWin = window.open(url,'page','height='+height+',width='+width+',resizable='+resizable+',scrollbars='+scrollbars+'') }
The above is the way its always been, they are just different size windows
Brad Web Hosting with SQL Server @ $24.95 per month
Regards - Spoon
Beginner? Need help installing the forums? - www.aslickpage.com/snitz_help.html
www.ASlickPage.com - Private Messaging |
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 25 July 2002 : 19:01:20
|
Im looking in inc_top.asp file on v3.3.05 and this is what i see....
<script language="JavaScript"> <!-- hide from JavaScript-challenged browsers function openWindow(url) { popupWin = window.open(url,'new_page','width=400,height=400') } function openWindow2(url) { popupWin = window.open(url,'new_page','width=400,height=450') } function openWindow3(url) { popupWin = window.open(url,'new_page','width=400,height=450,scrollbars=yes') } function openWindow4(url) { popupWin = window.open(url,'new_page','width=400,height=525') } function openWindow5(url) { popupWin = window.open(url,'new_page','width=450,height=525,scrollbars=yes,toolbars=yes,menubar=yes,resizable=yes') } // done hiding --> </script>
im saying combine all of these functions into one function.
Brad Web Hosting with SQL Server @ $24.95 per month
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 25 July 2002 : 19:38:33
|
I agree with redbrad0, I also think that adding a feature to center it based on resolution would be an easy add and much desired. I've started doing that on my demo site and will be live very soon.
<script> /* Auto center window script- Eric King (http://redrival.com/eak/index.shtml) Permission granted to Dynamic Drive to feature script in archive For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com */ var win = null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) }
</script>
and then call the windows using this:
<a href="http://wsabstract.com" onclick="NewWindow(this.href,'name','400','400','yes');return false">Website Abstraction</a>
http://www.nineinchnailz.com
Edited by - dayve on 25 July 2002 19:38:56 |
|
|
Spoon
Average Member
Ireland
507 Posts |
Posted - 28 July 2002 : 13:41:48
|
hmm think i was drunk when i posted that rubbish above..... i think its a great idea, reduces the amount of code and speeds up things for everybody
|
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 28 July 2002 : 15:34:39
|
It's a great idea to reduce it to one function. It would be less coding.
But then again, when i want to change or modify one of the pop_up windows, I will have to go searching through the code to find the link to modify it. As with the way it is, all I need to do is edit inc_top since all the functions are in one place. This is looking from a beginners point of view. If there was some gain for the forum apart from less coding (it just takes up 14 lines of code), then it would be something to consider. I think it would be a bit harder for new users who want to modify thier code.
«------------------------------------------------------» What new features are going to be in the 3.4 version? See the 3.4 UnOfficial Features List ! |
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 29 July 2002 : 20:58:11
|
Davio,
Yes you are correct about the new users part, but how often do you think people want to change the popup size? I really think it would be in odd cases. I like it better the way I posted it because I think its cleaner code, and when I want to popup a window for another page (not on the snitz forums) then I dont want to add a new function for each different size i want to popup.
Brad Web Hosting with SQL Server @ $24.95 per month
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 29 July 2002 : 21:32:52
|
quote:
I think it would be a bit harder for new users who want to modify thier code.
I think we should give new users more credit than that. every time there is a new mod that incorporates a new popup window they would have to add a function in inc_top.asp and in the code where the feature exists whereas with the one I have shown its a done deal, all they need to do is add the code where the feature exists and they control the size of the window very easily.
and we're forgetting one very other cool feature.. Auto Centering!! I really can't imagine anything else simpler than this.
and as Forrest Gump would say "that's all I have to say about that"
http://www.nineinchnailz.com |
|
|
|
Topic |
|
|
|