Solved

Issue with script Tag to resize Image

Posted on 2013-12-12
9
394 Views
Last Modified: 2013-12-13
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
Comment
Question by:myselfrandhawa
  • 4
  • 3
  • 2
9 Comments
 
LVL 42

Expert Comment

by:Chris Stanyon
Comment Utility
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
 
LVL 15

Author Comment

by:myselfrandhawa
Comment Utility
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
 
LVL 9

Expert Comment

by:Sar1973
Comment Utility
In Javascript:
myimg = document.getElementById("myImage").style.height/width = "Npx";
0
 
LVL 15

Author Comment

by:myselfrandhawa
Comment Utility
what is that and can you please explain
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 15

Author Comment

by:myselfrandhawa
Comment Utility
i updated it again, now check please

http://jsfiddle.net/gavy81/gJbm9/4/
0
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
Comment Utility
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
 
LVL 9

Expert Comment

by:Sar1973
Comment Utility
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
 
LVL 15

Author Closing Comment

by:myselfrandhawa
Comment Utility
Thanks Pal, U saved my Day
0
 
LVL 42

Expert Comment

by:Chris Stanyon
Comment Utility
Glad I could help ;)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn how to dynamically set the form action using jQuery.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now