image zoom and scrollbar

This is a discussion on "image zoom and scrollbar" within the JavaScript Forum section. This forum, and the thread "image zoom and scrollbar are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 15th, 2007, 02:54
New Member
Join Date: Feb 2007
Location: US
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
image zoom and scrollbar

Hi,
I'm working on modifying Discuz forum code to fit my purposes. One major change is about image zoom. The original setting is that when an image is wider than screenwidth*0.7, it will be automatically zoomed to *0.7. I want to disable zoom function, display images with original size.
Here is the code to display image attachment:
PHP: Select all

<!--{if !$attach['price'] || $attach['payed']}-->
 <!--{if 
$attach['thumb']}-->
  <!--{if (
$attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 03) == 'ftp&& !$ftp['hideurl'])}-->
   <
a href="attachment.php?aid=$attach[aid]&amp;noupdate=yes&amp;nothumb=yes" target="_blank"><img src="attachment.php?aid=$attach[aid]" border="0" alt="{lang image_thumb}" /></a>
  <!--{else}-->
   <
a href="$attach[url]/$attach[attachment]" target="_blank"><img src="$attach[url]/$attach[attachment].thumb.jpg" border="0" alt="{lang image_thumb}" /></a>
  <!--{/if}-->
 <!--{else}-->
  <!--{if (
$attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 03) == 'ftp&& !$ftp['hideurl'])}-->
   <
img src="attachment.php?aid=$attach[aid]&amp;noupdate=yes" border="0" onload="attachimg(this, 'load', '{lang image_open_zoom}')" onmouseover="attachimg(this, 'mouseover')" onclick="attachimg(this, 'click', 'attachment.php?aid=$attach[aid]')" onmousewheel="return imgzoom(this)" alt="" />
  <!--{else}-->
   <
img src="$attach[url]/$attach[attachment]" border="0" onload="attachimg(this, 'load', '{lang image_open_zoom}')" onmouseover="attachimg(this, 'mouseover')" onclick="attachimg(this, 'click', '$attach[url]/$attach[attachment]')" onmousewheel="return imgzoom(this)" alt="" />
  <!--{/if}-->
 <!--{/if}-->
<!--{/if}--> 
And here is the related javascript code about zoom, in "common.js":
PHP: Select all

function attachimg(objactiontext) {
 if(
action == 'load') {
  if(
obj.width screen.width 0.7) {
   
obj.resized true;
   
obj.width screen.width 0.7;
   
obj.alt text;
  }
  
obj.onload null;
 } else if(
action == 'mouseover') {
  if(
obj.resized) {
   
obj.style.cursor 'hand';
  }
 } else if(
action == 'click') {
  if(!
obj.resized) {
   return 
false;
  } else {
   
window.open(text);
  }
 }

I have tried to changed
PHP: Select all

 if(obj.width screen.width 0.7
into
PHP: Select all

 if(obj.width screen.width 3
After that, large images don't zoom any more, but I still want more:
1, since image is wider than screen, there should be a horizontal scrollbar in browser window. But it never happens.
2, when there comes such a large LINKED image (with vB code [img]) ----not attachment image---- if "mouseover", the image will be zoomed..... (attachment image is ok). How to fix this?
All in all, I want to achieve: all wide pictures do not zoom. And a horizontal scrollbar shows to fit the widest picture.
I'm new to javascript. Just read some basics, and can not find out what's wrong. So please help with this .
Thanks.
Reply With Quote

Reply

Tags
zoom

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 ondblclick handlers to zoom-in/zoom-out images benreynolds4 JavaScript Forum 4 May 23rd, 2008 19:39
[SOLVED] zoom and drag an image help lisafelst12 JavaScript Forum 9 Jan 3rd, 2008 12:59
Page Zoom R8515198 JavaScript Forum 1 Nov 30th, 2007 13:03
Scale/Zoom with AS PixelLuv Flash & Multimedia Forum 8 Mar 9th, 2007 22:26
zoom and scroll danieldear Flash & Multimedia Forum 6 Jul 7th, 2006 20:45


All times are GMT. The time now is 10:17.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43