Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mootool : remove css attribute

Posted on 2010-08-23
5
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 150 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

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…
Suggested Courses

722 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