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;
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?
I am making a PHP-MySQL site which has an image gallery page that generates thumbnail-sized versions of images (the paths are all in the DB) using the width= tag. I have it so that when you click on the thumbnail, a fixed-size window pops up with the actual-sized version of the image. The new window just displays the image itself with .jpg in the address bar, and not an HTML or PHP file that contains the image tags and path in it. Is there any way I can have the new window automatically adjust to the size of the image, or is it strictly a one-size-fits-all dealy?
I have a page where users click on a small thumbnail image to view a larger version of the image in a new window. But instead of just viewing the image file, I want them to view an HTML page that contains the image and a "Close Window" button. I know how to do that, and I know how to specify the size of the popup window. But...
What I'm trying to do is make the popup window just big enough for the image and the button, with perhaps a 10 pixel border around it. Since the images will vary in size, I can't hard code the width and height properties of the popup window. I need to have JavaScript measure the height and width of the image to calculate the dimensions for the popup window (and presumable this would have to be done before it opens the new window).
I want every time i click on a link a new window to appear.. The new window i want to have the dimensions of the included picture. Finally I want a close button on the window ..
An example of the resizing of an image can be seen here as well as at most photography galleries that are full-screen. You can see the size of the image change by shrinking your browser window. I want to make that gallery using javascript. I already have the ability to make a horizontal slider with left/right navigation - that part is easy. I just have never done anything with dynamic image sizes.One thing that was brought up to me already was the ability to shrink the browser window to fit.
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.
I so far have a scrollable image gallery of some thumbnails, I now wish to be able to click on the thumbnails and it load the corresponding full sized image with the website and everything else behind it being darkened/dimmed.the xhtml is structured like this so far, with no links to the full size images
where da boss wants our a large piece of our site to be fully dynamic and integrated on any screen size. This means changing font on size. Well I cam up with a solution, figured if no one has one better, then i'll share
I am new to Jquery mobile framework.I have an asp.net web application and I want to convert it into Jquery mobile framework.I have a datalist on an aspx page.The size of the datalist decreases according to the window size to certain extent after which the size of the datalist becomes constant and doesn't decrease with the window size.
I'd have thought this would be easy but I've been looking for hours and all I can find is info on getting the viewport size, which is normally useful but not in my situation.
In this case I need the actual browser size, including the scrollbars, toolbars, status bars etc. to get an idea of browsers which aren't maximised/full screen and how big they are, and to calculate the amount of the screen taken up by toolbars etc too.
I need a script that will open a new window (popup / new link) in a specific size, but will also close the old window (where the popup came from). I know the popup window is easy but finding a work-able close window script as the new window is opened is impossible!!
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.
I've got this row of images (in the end there will be more rows of pics as well). When a user clicks on the image, I want a new window to open with a larger version of the image. I want that new window to be customized to the size of the new larger image. Also, when users go back to see other images in their larger size, I want the new window (assuming they never closed the first one) to come back to the front.
I've only gotten as far as getting the larger images to open in a new window at a set size in the function. I thought I could just make specific scripts for each image, but that would be cumbersome to say the least....
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 :'( ).
I've been using pop-ups for some time now and I still can't figure out how to get the image to fit perfectly in the new window. There's always a few pixels of background showing and I have to increase the size of the window just to have the spaces around the image to even out. Is there any way to completely remove the vertical and horizontal spaces in pop-ups?
I've been trying to use HTML text that will scale up or down using the Internet Explorer 6.0 menu ViewText Size. I'm using CSS to set the sizes and weight.
When I use ViewText Size Medium and CSS the results are
Product line - font-size: medium - result bolded Pricing line - font-size: small - normal
When I use ViewText Size with any size not medium and CSS the results are
Product line - font-size: medium - normal Pricing line - font-size: small - normal
If I use font-weight bold for the Product Line I end up with double bolding when ViewText is set to Medium.
This inconsistant behavior of bolding makes it hard to have consistant looking fonts where the Product Line should be bolded.
If I use a set point size the text will not scale.
Is there a way of setting up fonts so that the results across the ViewText Size options is consistant?
Is it possible in Javascript to Size an element to its contents?
I have resizable divs with overflow=auto, and I'd like to plot them initially with fixed width and at the minimum height which will avoid the appearance of y-scrollbars.
I would be fine if I could find the actual total length of the included document given the current width of the div. (Calculating it would seem to be difficult, given unknown wrapping algorithms, empty lines, etc.)
Or somewhat less fine, even if I could question whether there is overflow, or clipping, or whether scrollbars have been added to the div, given the current height.
I could then hack the height till the overflow or clip or scrollbars went away. (Yuk!)
But I can't find any css or other read-only properties I could query that would give me any of those values.
I assume that YOffset or scrollY wouldn't help, since they would be 0 when the bottom is clipped off. (I don't even know if they're even defined for divs.)
I haven't been able to find a "scroll Object" that would say whether the scroll bar is showing.
I am trying to get frame re-sizing to work in Netscape 6, using the following JavaScript function:
function bannerframesize() { if (!document.all) {top.document.getElementById("cars_r_set").rows="40,*"} else {top.document.all.cars_r_set.rows="40,*"} }
The document.all method works for IE4 & IE5/5.5 and the document.getElementById method works with IE5.5 (I've proved this, although in the above function the document.all would take precedence with IE5/5.5), but it does not work with Netscape 6 (I can read the rows property value using this method, I just can't write to it). I've tried using both top.document.... and parent.document....
My JavaScript Bible (by Danny Goodman) states that the getElementById should work with Netscape 6 and that one can read AND write the <FRAMESET> rows property in Netscape 6.
I am building a webpage built with a column on the left, a header, and a main iframe which is the main content of the page. The content of the main iframe can get to be long, and I want the iframe to resize its height to fit the content. I know javascript can do this. I have seen many live examples of it working online. My problem is when I try and use the code myself (even if I leave the live example pages unchanged, but just save them and run them offline) it doesn't work. That is, the iframes work, the page works, but the iframe doesnt fit it's content.
Now, the page that I'm building is fully offline right now and I don't know if my javascript will work just fine if hosted on a domain and accessed online, but as it is it's not working and I don't know why. As an example here is some code, and the page it was taken from
I am using Dreamweaver to open a pop up window when you click in a thundnail to make the picture bigger. In Dreamweaver you have the option to specify the dimensions of the pop up window(in my case the same as the photograph). It seems to work fine in Explorer, but Safari leaves a white border along the right and bottom edges(aprox 14 pix). I have tried to do the window smaller but then in other browsers you need scroll bars. I would like the new window be exactly the same size of the photograph. Is there any easy way to control this?