PDA

View Full Version : JFriend's PayPal button move Javascript


BeachsidePaul
Apr-13-2009, 02:27 AM
Good morning all! John F. posted a javascript function to grab a PayPal button and move it to display in the altViews division of the page. Here's his original code:

YE.onContentReady("altViews", MovePaypalContent);

function MovePaypalContent()
{
var paypalObj = document.getElementById("paypalButtonSet");
var altViews = document.getElementById("altViews");
if (altViews && paypalObj)
{
var paypalSetObj = paypalObj.parentNode.removeChild(paypalObj);
altViews.appendChild(paypalSetObj);
paypalSetObj.style.display = "inline";
}
}

I modified this a bit to move the standard SM Buy and View Cart buttons to the same line as the style selector and slideshow buttons and thought all was well. (Thanks John!) Now I'm testing in IE7 and discovered that the Style and Slideshow buttons are floating to the left of the screen (above the breadcrumbs) for some reason. Everything is fine in Firefox and IE8 but obviously I missed, yet another, IE7 quirk.

here's a link to demonstrate my problem:
http://galleries.lightdynamicsphoto.com/gallery/7852712_cuSvB/1/510208110_sFjKC

Again, in firefox and IE8 all the buttons are on the right side of the display where they belong, the placement to the left is only on IE7.

Thanks for any help anyone my be able to give! Later, Paul

jfriend
Apr-13-2009, 08:52 PM
I'm traveling now and can't really take a look at this, but if you don't get it figured out by the end of the week, just post back here and I can take a look at what you've done and why it isn't working quite right in IE.

BeachsidePaul
Apr-14-2009, 12:42 AM
Thanks John and travel safe kind sir! It's got me stumped. Later, Paul

BeachsidePaul
Apr-16-2009, 08:21 AM
I see John is replying to some questions again, are you back kind sir? Thanks, Paul

jfriend
Apr-16-2009, 08:44 AM
I see John is replying to some questions again, are you back kind sir? Thanks, Paul Try adding this to your CSS:

#cartButtonsWrapper {float:none;}

BeachsidePaul
Apr-16-2009, 08:55 AM
:clap LOL Mr. Friend, that was too damn easy! Sorry to have bothered you, I actually tried "float:right;" with no luck. *sigh* too old for this new fangled stuff I guess. Thanks a million and I hope you had a great trip. Later, Paul