Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 421
  • Last Modified:

Issue with script Tag to resize Image

Ok, So here i am in a situation here, I have a code which is showing an Image through the script tag from an external website,

Basically it is a Jquery Code and inside that jquery code the Img Tag has ben defined using document.write and path is specified for the Image

So following i tried doing it with jquery or css but that image does not fit inside it

Do not why it giving an error:

Here is the jsfiddle of the code

http://jsfiddle.net/gJbm9/
0
Gurpreet Singh Randhawa
Asked:
Gurpreet Singh Randhawa
  • 4
  • 3
  • 2
1 Solution
 
Chris StanyonCommented:
On the fiddle, you're getting 2 errors - the first is because you're not loading the jQuery library and the second is because even if you do load it, you are then referring to it using $j instead of just $ (towards the end of your script)

Can't see what's going on because the call to the verisign script only produces:

<!-- x=1; -->
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
you are right, i have updated the jsfiddle now, please check

http://jsfiddle.net/gavy81/gJbm9/3/

If you run the code between the script in the browser, you will be able to see the javascript code and inside they have that seal image, need to detect that and show it in the browser with resized code which is in the above jsfiddle
0
 
Sar1973Commented:
In Javascript:
myimg = document.getElementById("myImage").style.height/width = "Npx";
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
what is that and can you please explain
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
i updated it again, now check please

http://jsfiddle.net/gavy81/gJbm9/4/
0
 
Chris StanyonCommented:
Right,

Your problem is that you are assigning the wideContainer DIV to the obj variable and not the image inside it!

Change this:

var obj = jQuery(this);

to this:

var obj = jQuery('img', this);
0
 
Sar1973Commented:
In JS you can call the image and resize its height/width with that syntax (see also http://www.w3schools.com/jsref/dom_obj_image.asp).
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
Thanks Pal, U saved my Day
0
 
Chris StanyonCommented:
Glad I could help ;)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now