Solved

mootool : remove css attribute

Posted on 2010-08-23
5
212 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Configuring a checkbox in CSS and php 18 94
Problem with spacing columns on a row in a table 10 29
Input box width 6 32
tiny glitch in my main slider 3 40
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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 …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

828 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