Solved

mootool : remove css attribute

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Suggested Courses

622 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