I have this on my css style: - <style type="text/css">
-
#container
-
{visibility:hidden;
-
width: 1000px;
-
position: relative;
-
margin-top: 0px;
-
margin-left: auto;
-
margin-right: auto;
-
text-align: left;
-
}
-
</style>
Then, I have this javascript code: - <script type="text/javascript">
-
window.onload=function(){
-
document.getElementById("container").style.display="???";
-
}
-
</script>
What I want to do, is to make the #container visible on page load.
But as I'm a newbie on css and javascript, I don't know what to put on style.display=" ???"; to make it visible.
I only know that if I put style.display=" none"; it will not display #container.
What do I put to make it display?
Thanks to anyone who can help me.
15 5156
Depending on what kind of element #container is, assuming it's a div, set it to 'block'.
I did that, but nothing appeared anyway
but thanks, I'll check again.
Dormilich 8,658
Recognized Expert Moderator Expert
you still have visibility set to "hidden". display is a completely different thing.
Then how do I make the div appear on page load?
Dormilich 8,658
Recognized Expert Moderator Expert
set the visibility to "visible"
yes, i know, but that's in the css style!
I want in the javascript
Dormilich 8,658
Recognized Expert Moderator Expert
then change the CSS in JavaScript.
How do I do that?
I have - <script type="text/javascript">
-
window.onload=function(){
-
document.getElementById("container").style.display="???";
-
}
-
</script>
How do I put css on that javascript?
P.S. thanks for the help
Dormilich 8,658
Recognized Expert Moderator Expert
How do I put css on that javascript?
you can use any CSS property via the JavaScript style object (like you did in the example with the display property).
but your CSS rule is not about display, it's about visibility.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: weichung[MCSD,MCDBA] |
last post by:
Hi,
I am currently having a .net Object whcih had been written in the code
behind. However, I wish to avoid a round trip from the client to server
(postback). Therefore I am wondering how could I achieve this?
Is it possible by declaring the object in javascript and perform the
object's method in the client side?
Any ideas are welcome, Thanks
|
by: tshad |
last post by:
I am trying to set some labels to display calculated values with posting
back to the server. So I am using Javascript to set the values of my
asp:label. The problem is that an asp:lavel renders into a span element.
For example:
function SalaryDisplay(me)
{
var salaryMinLabel = document.getElementById("SalaryMin");
salaryMinLabel.value = 200;
|
by: Anbu |
last post by:
All,
I'm developing an website using ASP .NET. I have developed a menu
structure based on JavaScript. This JavaScript file is called by an
UserControl to generate the menus.
It works fine for the WebPage that lies in the same folder. But when i
use the same control in another page (another directory) it's not
working property. It shows an error "Object Required".
|
by: Steve Sobol |
last post by:
http://gallery.stevesobol.com/activex-plain.html works in Firefox 1.5 and
Opera 9 but not in IE 6, and I can't figure out why.
The IE developer toolbar's DOM inspector shows the OBJECT tag and the PARAM
tags inside it, and if I don't have the Javascript in an external file, I'll
get the "click here to activate" tooltip and the border around what is
supposed to be the Flash movie. If I right-click inside the border, I get the
Flash...
|
by: andrei.csibi |
last post by:
I've have a .NET Assembly, which is COM Visible. I would like to load
objects from this assembly in javascript code. E.g. Assembly Book.dll
has the class Book and I would like to use
<script language="javascript" type="text/javascript">
var book = new Book();
document.write(book.Title);
</script>
Even more, if I could access book through the document object it would
be even more helpful, like:
<script language="javascript"...
| |
by: Saurabh |
last post by:
i want to create a table dynamically. Right now what i am using is a
string harcoded with the table structure with "<TD>"+values i want to
fill in the table dynamically.
and then padd this string to divID.innerHTML;
Is there a table object in javascript?
if there is How to use it????
|
by: MayBoy |
last post by:
Hi There
I am trying to use the Goto method of the Word ActiveX object. I am
trying to open a document and go to a named bookmark. If I use this
code in VB it works, so I'm sure the approach is possible, I just can't
get JavaScript to work with it.
Here is the code I am using, the error I get from IE is Object
Expected:
Hope someone can help! Any help would be much appreciated
|
by: Rob |
last post by:
Hi,
I'm getting an error on my login page when using Javascript session
object. It works on the development server so I'm wondering if there is
a setting in IIS to allow using sessions on the server.
When the user clicks on the submit button after entering their username
and password, it calls a function (below) and I get an "Object expected"
javascript error.
This is the function:
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |