Solved

mootool : remove css attribute

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Newbie CSS questions 4 27
css question 1 33
Text in block not displaying properly 2 17
How can I do a Select All on this page? 8 13
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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 position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now