Is there a sample page somewhere?

On Nov 16, 10:18 pm, gus <[EMAIL PROTECTED]> wrote:
> Hi i want to know if this code can be converted to jquery. It's a very
> good hoover pop up with effect code.
>
> function initCloseButton(){
>         var blocks = document.getElementsByTagName("li");
>         for (var i=0; i<blocks.length; i++){
>                 if (blocks[i].className.indexOf("roll") != -1){
>                         if ( blocks[i].className.indexOf("close") == -1 ) 
> blocks
> [i].className += " close";
>                         var links = blocks[i].getElementsByTagName("a");
>                         for (var k=0; k<links.length; k++) {
>                                 if (links[k].className == "button") {
>                                         links[k].onclick = function()   {
>                                                 if ( 
> this.parentNode.className.indexOf("close") != -1 ){
>                                                         
> this.parentNode.className = this.parentNode.className.replace
> ("close", "");
>                                                 }
>                                                 else{
>                                                         
> this.parentNode.className += " close";
>                                                 }
>                                                 return false;
>                                         }
>                                 }
>                         }
>                 }
>         }}
>
> var _timer;
> function initMSDropDown(){
>         $$('.home-page .top-block ul li').each(function(el, i){
>                 if ($(el).getElement('.sub-nav')){
>                         el._div = $(el).getElement('.sub-nav');
>                         el._h = $(el._div).getStyle('height').toInt();
>                         el._w = $(el._div).getStyle('width').toInt();
>                         el._i = i;
>                         $(el._div).setStyle('height', 0);
>                         $(el._div).setStyle('width', 0);
>                         el.onmouseover = function(){
>                                 if (_timer) clearTimeout(_timer);
>                                 startEffect(this);
>                         }
>                         el.onmouseout = function(){
>                                 _timer = setTimeout("disposeDivs()", 100);
>                         }
>                 }
>
>         });
>         disposeDivs();}
>
> function startEffect(elem){
>         if ($$('.sub-nav').length){
>                 $$('.sub-nav').each(function(des, i){
>                         $(des).setStyle('visibility', 'visible');
>                 });
>                 return;
>         }
>         if (elem._div){
>                 var _border = new Element('div', {'class': 'sub-nav', 
> 'styles':{
>                         'border':'1px solid #B8B8B8',
>                         'background':'none',
>                         'height': '15px',
>                         'width': '5px',
>                         'right': 0,
>                         'visibility': 'visible'
>                 }}).inject(elem);
>                 _border.moo = new Fx.Morph($(_border), {duration:100,
>                         onComplete: function(){
>                                 
> $(elem._div).getElements('*').setStyle('opacity', 1);
>                                 _border.innerHTML = elem._div.innerHTML;
>                                 $(_border).setStyle('background', '#FFFFFF');
>                         }
>                 });
>                 _border.moo.start({'height': elem._h, 'width': elem._w});
>         }}
>
> function disposeDivs(){
>         $$('.sub-nav').each(function(des, i){
>                 $(des).getElements('*').setStyle('opacity', 0);
>                 $(des).setStyle('background', 'none');
>                 des.moo = new Fx.Morph($(des), {duration:100,
>                         onComplete: function(){
>                                 $(des).dispose();
>                         }
>                 });
>                 des.moo.start({'height': 15, 'width': 5});
>         });}
>
> function initPage(){
>         initCloseButton();
>         initMSDropDown();}
>
> if (window.addEventListener){
>         window.addEventListener("load", initPage, false);}
>
> else if (window.attachEvent){
>         window.attachEvent("onload", initPage);
>
> }

Reply via email to