Category: Javascript
Cufon not working in Internet Explorer (IE) 9
Received an email from a client stating that their website was no longer working in Internet Explorer 9. Upon looking closer, I realized that the site was working/loading fine but that all the headings tags were missing. Given that each heading is wrapped in Cufon goodness, I decided the issue would originate there. Lo and Behold, Cufon has released an update to their 1.09 version, 1.09i, that fixes the issue for IE9 users.
From the Cufon site: if one doesn’t want to upload a new version of the .js file, simply add in the following:
<!–[if gte IE 9]>
<script type=”text/javascript”>
Cufon.set(‘engine’, ‘canvas’);
</script>
<![endif]–>
Be sure to put the above before the Cufon.replace() calls.
Another solution is to force IE9 to behave like IE8 (or 7):
<meta … Read More »
Magento – Show Sibling Categories using jQuery
For a recent Magento build, we needed to create some quick functionality for user testing. The end result was to show the children of the active category in the left navigation. Rather than build an entire Magento module, I opted to cheat a bit with jQuery and then, if it became a full out feature, build a module.
The left nav Magento code was greatly simplified and appears as such within /template/navigation/left_nav.phtml:
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
When a user lands on a top-level category page, the regular layout is created but the 2nd level children are cloned, then appended after the top-level parent Magento category, then removed. Comments in the jQuery below:
// When Cat is active, pulls siblings out to display alongside
if( jQuery(‘.parent.active’ , ‘#leftNav’).length > 0 ){
… Read More »
jQuery Show and Hide Part Tres
6th March
jQuery also affords the ability to trigger multiple events in succession using ‘string succession’. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.
jQuery Show and Hide Part Deux
6th March
Utilizing vanilla show/hide/toggle is a perfectly legitimate way to use said functions but when we start plugging in effects to the .show and .hide events, we really start to see the eye-candy that jQuery can offer. Using the same frame that we did in my last post on jQuery .show and .hide, we’ll add in a bit of eye candy to make this a cooler transition.
jQuery: Basic Show, Hide and Toggle
As you may have guessed, I’m not properly trained in the coding languages found throughout the web. Most, if not all of my knowledge has come from reading blogs, books and asking on Twitter. With this in mind, I’ve decided to post a few blog entries regarding the basics of using the jQuery library. Today, I’m going to look at two simpler functions to learn the basic syntax and use of jQuery. These are to show() hide() and toggle().
Recent Comments