Using Scriptaculous for slide down effect in some dynamic JS:

112 views
Skip to first unread message

John Knepper

unread,
Mar 7, 2012, 2:27:31 PM3/7/12
to Prototype & script.aculo.us
Hi, here's my javascript code defined in my header:


function destroy(idVal) {
var parNode = document.getElementById(idVal);
var childNode = document.getElementById(idVal +
"div");
parNode.removeChild(childNode);
}

function display(idVal, someText) {
var liNode = document.getElementById(idVal);
var expandEle = document.createElement('div');
expandEle.setAttribute('id', idVal + 'div');
expandEle.setAttribute('style', "-moz-border-radius:
20px; color: white; border-radius: 20px; background-color: #CDC0B0;
width: 90px; height: 100px; margin-left: 10px; padding-left: 15px;
margin-top: 10px; padding-top: 10px;");
expandEle.appendChild(txt);
var txt = document.createTextNode(someText);
expandEle.appendChild(txt);
liNode.appendChild(expandEle);
}


Essentially, I'm trying to do a:

new Effect.SlideDown(expandEle, {duration: 3});

, But to no avail. What is a way to add this fx to my display()
routine in order to have it show up onmousehover? Thanks!

Victor

unread,
Mar 8, 2012, 7:38:02 PM3/8/12
to prototype-s...@googlegroups.com
new Effect.SlideDown(expandEle, {duration: 3});

, But to no avail

What exactly is not working? You can make example at jsbin.com - we can find some solution faster. 
Reply all
Reply to author
Forward
0 new messages