Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

7on

macrumors 601
Original poster
Nov 9, 2003
4,939
0
Dress Rosa
So I've been put in charge of simplifying a client's code for their shopping cart. They bought a theme for $70 for Magento and are coming to us for "streamlining" etc. Anyway this has heaps of other issues, and coupled with the fact that this is my first Magento experience, it is a lot of work for what I believe it little impact.

What I think would make the biggest difference is switching to one javascript framework. If you're familiar with Magento you'd know that a lot of core functionality is built around prototype (& scriptalicious). The owners who run the site have added several plugins that use Jquery. Now I'm in the process of removing those plugins in favor of prototype based solutions.

What I'm running into is problems with .setStyle() (as an alternative to .css() in Jquery?). Here is my code:

Code:
<script type="text/javascript"> 
document.observe("dom:loaded", function() {
	$$('#specials a:first img').setStyle({marginTop:'14px'});
});
</script>

I make heavy use of Jquery in other sites for pseudo selectors to get IE compatibility. i.e. borderRight and excluding the last nav item

However, I am unable to get the above code to work. Any suggestions?

Also, what about the Jquery .after()? Is there an equivalent in prototype?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.