Solved

Issue with script Tag to resize Image

Posted on 2013-12-12
9
401 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39716235
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 16

Author Comment

by:Gurpreet Singh Randhawa
ID: 39716249
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
ID: 39716250
In Javascript:
myimg = document.getElementById("myImage").style.height/width = "Npx";
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Author Comment

by:Gurpreet Singh Randhawa
ID: 39716268
what is that and can you please explain
0
 
LVL 16

Author Comment

by:Gurpreet Singh Randhawa
ID: 39716271
i updated it again, now check please

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

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39716286
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
ID: 39716289
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 16

Author Closing Comment

by:Gurpreet Singh Randhawa
ID: 39716366
Thanks Pal, U saved my Day
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39716376
Glad I could help ;)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add - in a loop to first and last element. 6 41
boostsrap 6 15
CSS Won't Show Up On Drupal Omega Sub-Theme 1 11
Boolean 13 24
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

733 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