View Full Version : Non-coder wants easy way to scale up widget

01-14-2009, 12:35 AM
Hi - I have a javascript-related problem which might be quite simple to fix, but as I can't code anything above basic HTML I'm totally clueless.

The situation is as follows: I just installed a widget on my blog which randomly displays one newspaper front page from around the world every time it loads. You can see it in the right-hand sidebar at my site: www.riverscrap.com (hit refresh to see a different paper). There are two problems, though.

1. As you can see it's far from the optimum size. I really want the width to be 170 pixels every time, but editing the Javascript code below did not work. I'm guessing this is because the settings are all configured remotely at the source page? (PressDisplay.com). Is there a simple way of me 'zooming in' or 'scaling up' my widget? (Note btw that different newspapers are differently sized, so though the width should always be 170, the height must not be arbitrarily restricted).

2. There's an annoying border which I am once again powerless to get rid of. If you look at this page - http://riverscrap.typepad.com/home/googleebb4af1a3c23772c.html - you can see the border looks pretty nice on a white background, but not so much on grey. Is there a way of re-jigging the code so that it looks nicer on my grey background?

If anyone has any idea how I can customise those two features (size & border) simply by pasting in extra code, please do suggest something! As things stand the widget probably wouldn't be worth keeping, but with a little tweaking I think it would look fantastic on my blog.

Thanks in advance for any help :D


<script type="text/javascript"><!--
pdaff_id = "mDRo5OGz47do%2bbumP9U0Aw%3d%3d";
pdaff_channel = "hh";
pdaff_width = "130";
pdaff_height = "230";
pdaff_group = "Widgets";
pdaff_type = "FrontPages";
pdaff_name = "FrontPages";
pdaff_countries = "";
pdaff_cids =
<script type="text/javascript" src="http://affiliate.pressdisplay.com/Services/PDAffContentLoader.ashx"></script>

01-14-2009, 12:05 PM
as for the border, I assume the border is set by a style sheet but you could try forcing it using inline style

<script type="text/javascript">
(function(){var u="undefined";var src="http://affiliate.pressdisplay.com/AffObjectContent.aspx?pdaff_id="+pdaff_id+(typeof(pdaff_channel)==u?"":"&channel="+pdaff_channel)+(typeof(pdaff_width)==u?"":"&width="+pdaff_width)+(typeof(pdaff_height)==u?"":"&height="+pdaff_height)+"&group="+pdaff_group+(typeof(pdaff_type)==u?"":"&type="+pdaff_type)+"&name="+pdaff_name+(typeof(pdaff_countries)==u?"":"&countries="+pdaff_countries)+(typeof(pdaff_cids)==u?"":"&cids="+pdaff_cids);document.write("<iframe name='pdaff_frame' width='"+pdaff_width+"' height='"+pdaff_height+"' frameborder='0' src='"+src+"' style='border-Left:solid red 1px;border-Bottom:solid red 1px;border-Top:solid blue 1px;border-Right:solid blue 1px;' marginwidth='0' marginheight='0' vspace='0' hspace='0' allowtransparency='true' scrolling='no'></iframe>");})()

Ive used red and blue

as for the width and height your second link suggests this can be changed but you cant dynamically change the height as you need the height of find the iframe content and you can't as its from a different domain.