you can do something like this
var width = img.clientWidth;
var height = img.clientHeight;
var factor = 0.60;
var neww = width * factor;
var newh = width * factor;
$(img).css("width",neww+"px");
$(img).css("height",newh+"px");
if the logo is a fixed width, you don't need to do this calculations.
About finding "img", you can perhaps do something like
$("div.myclass img")... if is the only one by that path.
On 2 April 2012 11:46, Ben Stover <[email protected]> wrote:
> Assume web pages contains a logo with the following HTML spec:
>
> <div class="myclass">
> <img title="mylogo" alt=... src=...>
> </div>
>
> How can I shrink this image to 60% of its original size with GM?
>
> Ben
>
--
--
ℱin del ℳensaje.
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.