JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old January 16th, 2006, 04:27 AM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
Lock frame scroll

top.window.frames['mainFrame'].scrolling is undefined.

I'd like to lock temporarly on Event a frame scroll.

How could I obtain such a result ?

Reply With Quote
  #2  
Old January 16th, 2006, 07:54 AM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
I've just tried :
top.window.frames['mainMainFrame'].setAttribute("scrolling","no");

But, Mozilla Javascript Consol says :
top.window.frames.mainMainFrame.setAttribute is not a function.

Whereas top.window.frames['mainMainFrame'] is efficiently an [Object Window].

Reply With Quote
  #3  
Old January 16th, 2006, 08:09 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
Assuming the ID on your <FRAME> is mainMainFrame, try this:
Code:
document.getElementById("mainMainFrame").scrolling="no"
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
  #4  
Old January 16th, 2006, 08:23 AM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
When I do this :

Code:
alert(top.window.document.getElementById("mainFrame").scrolling);
top.window.document.getElementById("mainFrame").scrolling="no"
alert(top.window.document.getElementById("mainFrame").scrolling);

returns auto (the right original value) and no but, the scroll bar is still enabled.
(idem with : top.window.document.getElementById("mainFrame").setAttribute("scrolling","NO");)

Reply With Quote
  #5  
Old January 17th, 2006, 04:04 AM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
Has nobody the solution to that problem ?

Reply With Quote
  #6  
Old January 20th, 2006, 11:02 PM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 134 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 38 m 30 sec
Reputation Power: 4
It works in Firefox 1.5 but not in Firefox 1.0.7. What version of Mozilla are you using?

Reply With Quote
  #7  
Old January 23rd, 2006, 03:08 AM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
Quote:
Originally Posted by Kravvitz
It works in Firefox 1.5 but not in Firefox 1.0.7. What version of Mozilla are you using?


I usally work with Firefox/1.0.7 AND Internet Explorer 6.0.

Actually, I'd like it to disable scroll bar with I.E. (users of my intranet app desperatly mainly use it).

Reply With Quote
  #8  
Old January 23rd, 2006, 06:00 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 956 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 6 Days 8 h 23 m 34 sec
Reputation Power: 4
Send a message via ICQ to Itsacon
I once again say: Don't try to control a browsers behaviour!
If your app doesn't work if a frame can scroll, make is so it DOES work.

What if I opened the frame in a seperate window?

Or in Lynx?

Sites like that only make me hit the 'disable javascript' button in my browser.
__________________
This is my code. Is it not nifty?

"The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools."
---Douglas Adams


Join the Itsacon fanclub!    
Zero Tolerance: Spammers banned so far: 264

Last edited by Itsacon : January 23rd, 2006 at 06:04 AM.

Reply With Quote
  #9  
Old January 23rd, 2006, 07:03 AM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
That kind of comment really brings a lot to the debate...

Reply With Quote
  #10  
Old January 23rd, 2006, 07:34 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 956 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 6 Days 8 h 23 m 34 sec
Reputation Power: 4
Send a message via ICQ to Itsacon
Ok, more clearly explained:

The reason you're having trouble getting different browsers to do this, is because it's not a standard function.
If it was, you wouldn't be mucking about in Javascript, you would simply set the (hypothetical) HTML 'noscroll' attribute (or the CSS equivalent, if you were wise).
But that attribute doesn't exist. It's not in HTML, because HTML defines what the different sections of the document represent, and it's not in CSS, because CSS defines how something is displayed, and if you want a part not to display, to set it to HIDDEN, you don't scroll it away, lock the scrollbar and throw away the key (metaphorically speaking).
So people who wanted weird things started mucking about in javascript, then Microsoft started mucking about in javascript, etc, resulting in endless different versions of the aforementioned scripting language, with tons of functions only supported in browser X provided you have version 3.14.1.5.9.2.65.4.etcera.

Javascript is great for 'smart' forms, for the rest, use CSS.

Oh, and don't get me started on CSS support on IE.
But then, people using IE have simply failed their drivers licence for the information highway.

Reply With Quote
  #11  
Old January 23rd, 2006, 08:06 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
I'll throw my two cents in here.

First, Itsacon, I love that line: people using IE have simply failed their drivers licence for the information highway.

I think the moral issue here lies with the use of the application... Public websites should NOT try to control a browser's behaviour... I fully agree with Itsacon here.

However, if it's an internal application for a company's internal website/intranet, there may be a reason to do stuff that may be deemed naughty otherwise. Plus, if your company standard is [*cringe*] Internet Explorer in a Windows environment, it may be excusable if your site/page design is tailered more for IE. Why would you bother worrying about Firefox or Safari?

Overall, however, I believe standard webdesign should be the front-most concern no matter where you're developing; however, if you need to let a few things slip, that should be alright.

Reply With Quote
  #12  
Old January 23rd, 2006, 08:08 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
In direct relation to the question -- not a rant based on Itsacon's position () -- Jackot, you've pointed out that this is for internal use.

I still raise the question though, if you disable scrollbars, what happens if the content flows off the screen?

Reply With Quote
  #13  
Old January 23rd, 2006, 10:13 AM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 134 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 38 m 30 sec
Reputation Power: 4
Itsacon, it sounds like you don't like JavaScript much. IE doesn't support JavaScript. It has JScript which is a clone of JavaScript with a few changes.

The scrolling attribute of frame elements is included in HTML 4. In general the values of HTML attributes can be changed via the DOM, however, there are some attributes in each browser that haven't been given that functionality. When accessed via the DOM X/HTML attributes are referred to as properties.

Setting the scrolling property of frames dynamically works in Firefox 1.5 (Mozilla 1.8) but not in Firefox 1.0.7 (Mozilla 1.7). It works in Opera 7.23+ but does not seem to work in IE6. Only Firefox 1.5 (Mozilla 1.8) seems to allow disabling the scrollbar of frame elements via the CSS overflow property.
Note: I only tested these things on Windows browsers.

Quote:
Originally Posted by MadCowDzz
Public websites should NOT try to control a browser's behaviour... I fully agree with Itsacon here.

However, if it's an internal application for a company's internal website/intranet, there may be a reason to do stuff that may be deemed naughty otherwise. Plus, if your company standard is [*cringe*] Internet Explorer in a Windows environment, it may be excusable if your site/page design is tailered more for IE. Why would you bother worrying about Firefox or Safari?

Overall, however, I believe standard webdesign should be the front-most concern no matter where you're developing; however, if you need to let a few things slip, that should be alright.

I agree.

Reply With Quote
  #14  
Old January 23rd, 2006, 11:11 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 956 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 6 Days 8 h 23 m 34 sec
Reputation Power: 4
Send a message via ICQ to Itsacon
Actually, I'm not that much against J(ava)Script.

I just hate it when people use it to limit a users abilities, when it's only a hindrance to most people. Simple example: A lot of sites use javascript to keep people from right-clicking images to save them. Why? Any decent browser can deactivate javascript to get the image anyway (In Opera, there are actually settings on how much you let javascript do in general), or you can simply grab it using wget.

There are plenty of good uses for JavaScript however, I've used itplenty of times:
  • Form validation. It's great to show a popup when people enter invalid entries in a form. Of course you still need to check the input in the following page (PHP or something like that), in case people disable javascript, but adding the JS check as well can save a user valuable time submitting and reloading the page.
  • Smart forms. I have plenty of forms where fields are re-populated based on the choices made in the same form. When done right, using the proper DOM attributes, this works on pretty much all browsers (with exceptions such as Lynx of course), and can, again, save a user a lot of submitting and reloading, by eliminating the need to make every step a new form.
  • Programs. JavaScript is a nigh-complete programming language, and you can do some amazing stuff with it, up to and including image-editing. You should ask Icon sometime.

There are undoubtly plenty of other good uses for JS, but limiting a user's abilities to use his own browser is simply not one of them, if you ask me.
Comments on this post
Icon agrees: I _have_ to agree with this post for obvious flattering reasons ;-) and IE is evil!

Reply With Quote
  #15  
Old January 23rd, 2006, 11:35 AM
Jackot29 Jackot29 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Paris, FRANCE
Posts: 29 Jackot29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 10 sec
Reputation Power: 0
Explaining why I want to lock a scrollbar would be busy but I'm gonna try to :

I open a pdf document inside an iframe which temporarily covers totality the navigator window so that the user cannot activate another link of the main window before having closed the div which includes the iframe.

As the content of the main window is large, it must contain a scroll bar.

Man must know that several pages of my Intranet site are succeptible to be simutaneously opened (in order to compare MySQL datas), that's why it is almost inevitable to limit the number of blank-targeted links and use temporary iframes (keeping many user-defined informations on main-window configuration in a simple way)...

I'm not sure on being clear but, I would have needed such a configuration under IE5+.

Reply With Quote