Changing Image Size In Percentage?

Dec 1, 2011

I am implementing a zoom in feature, but actually tricking the user as a full screen image is simply being stretched.

I plan to apply it to several pages, and don't really fancy working out the pixels for each.

I believe that if you simply put width: 150% height 150% it will change the image size relative to the browser. I don't want that, I want it relative to the original image size. Could I do sort of height*1.5 or something? How would I write that if so?

<script>
$('#in').click(function() {
$('#drag img').animate({
width: '150%',

[Code]....

View 2 Replies


ADVERTISEMENT

Sizing A New Window By Percentage Of Image Size?

Mar 25, 2009

I didn't write much of this code, but basically, it opens an image in a new window. The problem is that the new window can either be the whole page, or a certain set size. I would like to make the window height and width determined not by a pixel number, but by a percentage of the size of the image I am opening in the new window.

here is the piece of code I think is pertinant.

// Strip file name from image src
var spath=targ.getAttribute('src');
wholePathLength=spath.length;
strippedPathLength=spath.substring(0,spath.lastIndexOf("/")).length;

[Code]....

View 10 Replies View Related

Changing Image Size

Jul 23, 2005

I've made a gallery that has thumbnails along the top and clicking them
changes the source for the full size image below, but it seems I can't
change the image size.

A workaround I made up is to put the fullsize image tag inside a div
tag. Clicking a thumbnail changes the innerHTML of the div to an image
tag with the proper size and source.

I'm wondering if this is the way to do it or if there's a better, more
proper way?

View 1 Replies View Related

Size Image To Fit Window (without Cropping Or Changing Ratio)

Oct 19, 2011

I'm trying to size an image to fit the browser window. It will be the only thing in the frame, so it doesn't matter if it's the background or not. I've found quite a few ways to have the image automatically resize itself where it either gets cropped off or changes ratio to stretch, but I've not found anything where it'll keep the full image and ratio and just have bars top and bottom or sides.

View 14 Replies View Related

Percentage Calculator With Percentage Bar?

May 24, 2011

Dont know if it can be done but.... I am using the percentage calculator

<SCRIPT language=JavaScript>
<!--
//Script by Tom Richardson Jr.

[code]....

View 2 Replies View Related

Possible To Re-size Image To Fit Window Size?

Aug 31, 2011

I started learning javascript couple of days ago, so this may be a noobie question.

I wrote a simple code that should re-size the image (there's some other code in here just in case) code...

View 1 Replies View Related

Re-size Image To Fit Window Size?

Aug 31, 2011

I started learning javascript couple of days ago, so this may be a noobie question.

I wrote a simple code that should re-size the image (there's some other code in here just in case) code...

View 4 Replies View Related

Changing Font-Size

Nov 9, 2006

More and more we see on web pages the option of choosing the font size.

I would like to offer the same option on my page, but I can get started.

I know that CSS and Javascripting are working together, I just not able to change the font-size property of the CSS.

View 2 Replies View Related

Changing Window Size

Oct 5, 2003

I have a photo gallery which lists out a bunch of photos. You can click on one which will open the photo in another window for you to view. In this window then, you are able to go to the next image, to the previous one, etc.

Now, I have some images which are portrait style, some are landscape. I want to have the window that the images show in to be adjusted on the fly depending on the orientation of the photo. I.e., if the photo is landscape, I want to display it in a window which is 800x600 in size; if it's portrait, I want to display it in a window which is 600x800.

All the thumbnails have the following code for their href: Code:

View 1 Replies View Related

Changing Date Size

May 31, 2006

I have a java script that I like and recently changed the text on the page to 10 pt. but can't figure out how to change this script to 10.

<SCRIPT language="JavaScript" type="text/javascript">
<!--
// current date
// Array of day names
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

var monthNames = new Array("January","February","March","April","May","June","July",
"August","September","October","November","December");

var dt = new Date();
var y = dt.getYear();

// Y2K compliant
if (y < 1000) y +=1900;

document.write(dayNames[dt.getDay()] + ", " + monthNames[dt.getMonth()] + " " + dt.getDate() + ", " + y);
// -->
</SCRIPT>

Any ideas?

View 3 Replies View Related

JQuery :: Font Size Not Changing?

Sep 15, 2011

I;m trying to implement increase/decrease font size buttons on a site, but nothing is happening. I've set breakpoints and tried changing $('html') to $('body') and although the code runs, no attributes are set. The code I'm using is:

[Code]...

Even if I remove the cookie, the code runs but nothing happens. Am I missing something obvious?

View 1 Replies View Related

InnerHTML / DIV Size Changing To Various Strings

Dec 21, 2010

I was playing around with some onmouseover/onmouseout and setting innerHTML to various strings depending on what has been mousedover/out. The DIV for the innerHTML was above the items being onmouseovered/out and because the strings sent were of different lengths, sometimes a one or two line wrap would happen and everything below it would be resized accordingly creating a horrible effect. For reference, what is a good way to approach building pages which are immune to this effect?

View 12 Replies View Related

Moving Img While Gradually Changing Its Size

Apr 22, 2010

I'd like to move a gif gradually, starting at onload, from one location to another on the screen, while gradually making it larger. The moving part seems easy enough to do, using img.style. left=parseInt (img. style. left=1='px'; in a recursive function.But I understand that img.style.width (and img.width) and img.style.height are read-only properties, so I guess I can't use them to change the image's size (?). Is there a way to change the gif's size starting at onload?

View 4 Replies View Related

Show Image In The Image Box Without Stretching Its Original Size Of The Image?

Sep 27, 2011

i have image button i need to display image .if the size of the image button is 100*100 and image size is 50*50 .the remaining space of the image button should be empty.the image should not stretch.

View 1 Replies View Related

Changing Font-size Property In Body Definition?

Mar 27, 2010

I've got a website with font sizes using 'em's. I've made it so that in my 'body' CSS styling, I can change the font size and it changes it right throughout the whole site.

I have hyperlinks to increase and decrease the font size but have no idea how to get the links to change the 'font-size' property in my 'body' definition. As a secondary requirement (but not essential) I also need to remember this value and store in a cookie so the user doesn't need to keep resizing the page on every reload.

View 4 Replies View Related

JQuery :: Changing Font-size Based On Characters Count?

Sep 10, 2010

I'm reading jQuery in Action for my learning and thought I could start with a simple exercise for my page: I have several divs of the class ".important_new" with headings in there which are links to the articles:

<div class="important_new">
<h1><a href="#">New York Knicks sign Patrick Ewing Jr.</a></h1>
<img class="important_new_flag" src="images/body/flags/USA.png" />
<span class="important_new_country">USA</span>

[Code]....

This results in displaying all the headings in an 8px font size except two of them (which don't have more than 40 characters either). The 40+ character headings also get reduced.

I've gone through it lots of times and changed a ton of things, but can get more than that. Can anyone see what my failing/s are?

View 2 Replies View Related

Image Changing And Changing InnerHTML With JS : Query

Jul 6, 2011

Ive got a small image of a power button and when pressed the inner section on the button changes to yellow, but when its pressed down Im also trying to get part of my H1 (main header logo title) to change to yellow.

Ive created a span with an id surrounding the letters of the H1 that I want to change, the id being : "power";

The javascript that I have come up with so far and works is as follows:

<img id="poweron" src="http://www.sitepoint.com/forums/images/power.png" alt="Power on button" onmousedown="this.src='images/poweron.png';" onmouseup="this.src='images/power.png';"/>

I understand Im not really supposed to be using inline JS, and I know Ive got to create a function for the onmousedown event to trigger changing the H1 text, so am I under the right impression that the JS so far written is redundant and will have to be re-written so thats contained within a script placed just before the closing </body> and an external script for invoking the main function ?

View 2 Replies View Related

JQuery :: Size Of An Image In A Div (image Bigger Than The Div)?

May 26, 2010

I'm having a little trouble with something a bit ridiculous. I have an image in a div, let says that the image's width is 100px (but in fact 300px, resize with em) and the div's width is 75px (it's an absolute div created by a plugin). I tried to do $('img').width() naturally, but it gave me the div's width. I tried some natives javascript methods (clientWidth, offsetWidth and scrollWidth), same things (but Firebug is saying that clientWidth is 100px, not 75px :'( ).

View 4 Replies View Related

Slide Show Gets To The Last Image After The Last Image All Photos Disappear And It Resets Itself Changing The Format Of The Webpage

Jun 12, 2009

I found this slide show [URL]. I got it to work on my website [URL] using Firefox, but when it is viewed in Internet Explorer it will not work. Second question, When the slide show gets to the last image, after the last image all photos disappear and it resets itself changing the format of the webpage. Any way to not have the images disappear while it loops itself or is there a code to have it stop on the last photo and not loop.

View 1 Replies View Related

Get Image Size

Aug 14, 2007

can anybody tell me how to get the size of image using javsacript that can run both on IE,FF and safari.

i want to check if the image is greater than 2mb of size it should give an alert message to user ....

View 1 Replies View Related

JQuery :: Get Size Of An Image?

Mar 6, 2011

I have a link, and in this link have in href="link to my image", how do i get the size of the image inside href?

View 7 Replies View Related

Get Image Size Before It Is Uploaded?

Apr 1, 2009

I am allowing users to upload images using an input with a type of file. Ideally what I'd like to do is use Javascript to get the size of the image that their trying to upload and to error if the image is too large.I'm using php to resize the image, but I'd like to warn the user before they submit the form, so they don't have to go back and start again.

View 1 Replies View Related

Change Image Size With DOM

Jul 9, 2007

I have following image on my page, I use it as a spacer gif to get correct columns sizes.

<img id="leftcolumnspacer" src="images/spacer.gif" alt="">

I also enable the admin to preview the site in an iframe and change size of for exp. left column. Playing with td sizes do not give me exact pixel sizes, so I would like to make sure that a td is displayed correctly, by resizing the spacer gif.

var LeftColumnSpacerWidth = myForm.leftcolumnspacer_width.value; // comes from the form
var leftcolumnspacer = frames['testsite'].document.getElementById('leftcolumnspacer');
leftcolumspacer.style.width = LeftColumnSpacerWidth;

Why would this code not change the sizes of an image dynamically?

View 11 Replies View Related

Mod The Code So Each Image Is The Same Size?

Mar 31, 2010

I found this code on another website and have been trying to mod the code so each image is the same size. but it will no even compile.So I am a bit fustrated right now. Any help on this topic<!-- Begin

var speed = 5000
var size = 75,100px
var Pic = new Array() don't touch this

[code]....

View 2 Replies View Related

Background Image Re-size?

Dec 23, 2009

I really like the technique that has been used here to re-size the background image. Does anyone know where I can get a script that will do this.

View 1 Replies View Related

Getting Image Size Values

Sep 8, 2003

I've made a script that "sometimes" retrieves the width and height of a preloaded image, but it doesn't always work.

The intent was to select thumbnails from my webpage and open a new window that was the precise size of the larger image file.

About 20%, it works. I think IE caching is helping me without my knowledge.

Does anybody know a reliable way to get size info from an image file?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved