Need to run jQuery and Mootools side by side

You can run both jQuery and Mootools libraries on the same site, but there is a trick.

Add the link jQuery.noConflict(); to that last line in your jQuery js libary (jquery-1.3.2.min.js)

This will change the namespace that jQuery uses from $ to jQuery.  This way jQuery and Mootools won’t step all over each other.

You do have to change all your jQuery functions to use jQuery instead of $.

I assume this works also if you trying to integrate jQuery with the ASP.NET Ajax libraries, but I have not tested it in that scenario.

Here is a link explaining in more detail.
http://docs.jquery.com/Core/jQuery.noConflict

Advertisements

JS to tell if an object is viewable on the screen

 
Here is some JavaScript that has a function to tell if an object 
is viewable on the screen.
This is quite helpful if you have something on the screen you 
want to make sure the user sees,

like a an error or license agreement, etc.
 
<HTML>
<HEAD>
<SCRIPT>
function isinView(oObject)
{
    var oParent = oObject.offsetParent;
    var iOffsetTop = oObject.offsetTop;
    var iClientHeight = oParent.clientHeight;
    if (iOffsetTop > iClientHeight) {
        alert("Special Text not in view. Expand Window to put Text in View.");
    }
    else{
         alert("Special Text in View!");
    }
}
</SCRIPT>
</HEAD>
<BODY onload="window.resizeTo(430,250)" onclick="isinView(oID_1)"  SCROLL=NO>

<DIV STYLE="position:absolute;left:20px">Click anywhere in window to see if special text is in
view.</DIV>

<DIV id="oID_1" STYLE="position:absolute; left:50px;top:300px;width:280px;color:lightGreen;
font-size:large;font-weight:bold;background-color:hotPink;font-family:Arial">
            Here's some special text
</DIV>
</BODY>
</HTML>
Technorati Tags: ,