Solved

mootool : remove css attribute

Posted on 2010-08-23
5
208 Views
Last Modified: 2012-05-10
hi,
I am using mootool and  i have the following css

#social_wrapper {
      z-index: 10;
      position: absolute;
      top: 27px;
      right: 0;
      visibility: hidden;
}

and i want to remove the visibility when onclick
0
Comment
Question by:bcv2010
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:Snarfles
ID: 33501302
Is it not a case of simply removing the line?

or change it to

visibility: visible;

If not I dont understand the question.
#social_wrapper {
      z-index: 10;
      position: absolute;
      top: 27px;
      right: 0;
}

Open in new window

0
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 33501858
Add this to your onclick javascript in the element in question:
onclick = "this.style.visibility = 'hidden';"

I Can't help to mention tho, what are you trying to achieve?  visibility still leaves the space there just can't see it.

Most of the time I will use display = none.  This will removed the entire element from the page.  So it would look like this:

onclick = "this.style.display = 'none';"

also if it's not the clicked element you want to go away you'll need to use this:
onclick = "document.getElementById('<element name>').style.display = 'none';"
0
 

Author Comment

by:bcv2010
ID: 33504309
sorry. suppose the script should use mootool to remove the css attribute.. i have done that in JQuery but unfortunately the site i am wrking on is using mootool...  

bsically i want to hide the div having id =social_wrapper. Onload page it will hide the panel havng id=social_wrapper . when onclik [ in mootool it is click function () ....   ] ....

hope this clarify the question
0
 
LVL 9

Accepted Solution

by:
CCSOFlag earned 50 total points
ID: 33504593
try this out:
 
window.addEvent(‘domready’,function(){
Element.extend(     //Implement the following functions in every  element existent in the webpage
         {
             show:function(e){
           
             this.setStyle(‘display’,'block’);
           
             },
             hide:function(e){  
             this.setStyle(‘display’,'none’);
           
             }
         }
         );
});


<span onclick=”$(‘<element>’).hide();”>Hide</span>
<span onclick=”$(‘<element>’).show();”>show</span>

From this site:
http://www.sanjeevshrestha.com.np/2009/04/simple-show-hide-with-mootools/

0
 

Author Closing Comment

by:bcv2010
ID: 33753625
don;t have time to test on the solutions, therefore accept it as the reference
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question