diff options
author | Bryan Berry <bryan@olenepal.org> | 2009-12-13 07:14:20 (GMT) |
---|---|---|
committer | Bryan Berry <bryan@olenepal.org> | 2009-12-13 07:14:20 (GMT) |
commit | 5f5ab033f4cabc489ac9ae3b0c5d209869ef18bc (patch) | |
tree | 6535085ebc496a3092ce191a9dc756e23fe7499c | |
parent | 5fee5efe46f73f17402b08b33781336a31d3b503 (diff) |
changed Conozco to use jquery SVG's .css() function over manual manipulation
-rwxr-xr-x | examples/Conozco-Uruguay/js/lesson.js | 21 | ||||
-rw-r--r-- | js/jquery.svgdom.js | 2 |
2 files changed, 9 insertions, 14 deletions
diff --git a/examples/Conozco-Uruguay/js/lesson.js b/examples/Conozco-Uruguay/js/lesson.js index ac3e810..bc296ca 100755 --- a/examples/Conozco-Uruguay/js/lesson.js +++ b/examples/Conozco-Uruguay/js/lesson.js @@ -150,17 +150,13 @@ $(document).ready( mapElem.id.toLowerCase()){ var part = parts.splice(0,1)[0]; - $('#' + part, spaceshipRoot)[0].style.display = 'block'; + $('#' + part, spaceshipRoot).css('display', 'block'); alienBubble.text("Correct! " + question.capitalName + " is the capital of " + question.deptName); var text = $('.text.' + question.dept, capRoot); - var textCapital = text[0]; - var textDept = text[1]; - textCapital.style.display = "block"; - textDept.style.display = "block"; - displayedItems.push(textCapital); - displayedItems.push(textDept); + text.css('display', "block"); + displayedItems.push(text); if (parts.length === 0){ // We're done! @@ -168,7 +164,6 @@ $(document).ready( alienBubble.text("Great Job! I can go home now."); setTimeout(function(){ $('#alien').hide(); - //$('#sideTop').hide(); flyAway(); }, 1000); @@ -197,11 +192,11 @@ $(document).ready( var toggleFires = function(){ if(isLaunching){ if(toggle){ - shipFire1[0].style.display = "none"; - shipFire2[0].style.display = "block"; + shipFire1.css('display', "none"); + shipFire2.css('display', "block"); }else{ - shipFire1[0].style.display = "block"; - shipFire2[0].style.display = "none"; + shipFire1.css('display', "block"); + shipFire2.css('display', "none"); } //toggle fires toggle = !toggle; @@ -285,7 +280,7 @@ $(document).ready( var hideDisplayedItems = function(){ for (var i = 0; i < displayedItems.length; i++){ - displayedItems[i].style.display = 'none'; + displayedItems[i].css('display','none'); } }; diff --git a/js/jquery.svgdom.js b/js/jquery.svgdom.js index b5053fd..e350298 100644 --- a/js/jquery.svgdom.js +++ b/js/jquery.svgdom.js @@ -147,7 +147,7 @@ $.fn.css = function(name, value, type) { var jsName = revAttrName(n);
console.log(jsName);
this.style[jsName] = options[n];
- // (typeof options[o] === 'function' ? options[n]() : options[o]);
+ (typeof options[n] === 'function' ? options[n]() : options[n]);
} else {
this.style.setProperty(n,
typeof options[n] == 'function' ? options[n]() : options[n]);
|