The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Image Scroll

View previous topic View next topic Go down

Image Scroll

Post by xiaomah01 on January 1st 2012, 4:03 pm

is Possible to add this function in forum for all image ???

demo:
http://johor.forumn.org/h39-page
(scroll on image)

xiaomah01
Forumember

Male Posts : 206
Reputation : 7
Language : English|Chinese|malay
Location : malaysia

http://johor.forumn.org/

Back to top Go down

Re: Image Scroll

Post by Guest on January 1st 2012, 4:20 pm

Before </body> add this script:
Code:
<script language="JavaScript">
<!--
function resizepic(thispic){
   if(thispic.width>700) thispic.width=700;
}

function bbimg(o){
   var zoom=parseInt(o.style.zoom,10)||100;
   zoom+=event.wheelDelta/12;
   if(zoom>0) o.style.zoom=zoom+'%';
   return false;
}
-->
</script>
Explication:
if(thispic.width>700) thispic.width=700 = If width of the image are more than 700px set that the image have only 700px, this code lock the big width. It's like maximum widht.
The rest of the script doesn't need to modify. Smile

Guest
Guest


Back to top Go down

Re: Image Scroll

Post by xiaomah01 on January 1st 2012, 4:54 pm

Gassy wrote:Before </body> add this script:
Code:
<script language="JavaScript">
<!--
function resizepic(thispic){
   if(thispic.width>700) thispic.width=700;
}

function bbimg(o){
   var zoom=parseInt(o.style.zoom,10)||100;
   zoom+=event.wheelDelta/12;
   if(zoom>0) o.style.zoom=zoom+'%';
   return false;
}
-->
</script>
Explication:
if(thispic.width>700) thispic.width=700 = If width of the image are more than 700px set that the image have only 700px, this code lock the big width. It's like maximum widht.
The rest of the script doesn't need to modify. Smile

is no work bwi

xiaomah01
Forumember

Male Posts : 206
Reputation : 7
Language : English|Chinese|malay
Location : malaysia

http://johor.forumn.org/

Back to top Go down

Re: Image Scroll

Post by Guest on January 1st 2012, 5:06 pm

Works if you put in a HTML page. Like this should be your page:
Code:
<html>
<head>
<script language="JavaScript">
<!--
function resizepic(thispic){
  if(thispic.width>700) thispic.width=700;
}
 
function bbimg(o){
  var zoom=parseInt(o.style.zoom,10)||100;
  zoom+=event.wheelDelta/12;
  if(zoom>0) o.style.zoom=zoom+'%';
  return false;
}
-->
</script>
</head>
<body>
<img src="YOURIMAGELINK"  border="0" onload="javascript:resizepic(this)" onmousewheel="return bbimg(this)" />
</body>
</html>

Guest
Guest


Back to top Go down

Re: Image Scroll

Post by xiaomah01 on January 1st 2012, 5:14 pm

Gassy wrote:Works if you put in a HTML page. Like this should be your page:
Code:
<html>
<head>
<script language="JavaScript">
<!--
function resizepic(thispic){
  if(thispic.width>700) thispic.width=700;
}
 
function bbimg(o){
  var zoom=parseInt(o.style.zoom,10)||100;
  zoom+=event.wheelDelta/12;
  if(zoom>0) o.style.zoom=zoom+'%';
  return false;
}
-->
</script>
</head>
<body>
<img src="YOURIMAGELINK"  border="0" onload="javascript:resizepic(this)" onmousewheel="return bbimg(this)" />
</body>
</html>

i know...but i want work in forum~

forum all img can use this function

(That html page is my create bounce )

xiaomah01
Forumember

Male Posts : 206
Reputation : 7
Language : English|Chinese|malay
Location : malaysia

http://johor.forumn.org/

Back to top Go down

Re: Image Scroll

Post by Guest on January 1st 2012, 5:51 pm

Try to add this in your JS management:
Code:
$(function(){
$('img').attr('onload', 'javascript:resizepic(this)');
$('img').attr('onmousewheel', 'return bbimg(this)');
)}

<!--
function resizepic(thispic){
  if(thispic.width>700) thispic.width=700;
}
 
function bbimg(o){
  var zoom=parseInt(o.style.zoom,10)||100;
  zoom+=event.wheelDelta/12;
  if(zoom>0) o.style.zoom=zoom+'%';
  return false;
}
-->

Guest
Guest


Back to top Go down

Re: Image Scroll

Post by xiaomah01 on January 1st 2012, 6:08 pm

Gassy wrote:Try to add this in your JS management:
Code:
$(function(){
$('img').attr('onload', 'javascript:resizepic(this)');
$('img').attr('onmousewheel', 'return bbimg(this)');
)}

<!--
function resizepic(thispic){
  if(thispic.width>700) thispic.width=700;
}
 
function bbimg(o){
  var zoom=parseInt(o.style.zoom,10)||100;
  zoom+=event.wheelDelta/12;
  if(zoom>0) o.style.zoom=zoom+'%';
  return false;
}
-->

thanks...but is no work

xiaomah01
Forumember

Male Posts : 206
Reputation : 7
Language : English|Chinese|malay
Location : malaysia

http://johor.forumn.org/

Back to top Go down

Re: Image Scroll

Post by xiaomah01 on January 2nd 2012, 6:01 pm

bump albino

xiaomah01
Forumember

Male Posts : 206
Reputation : 7
Language : English|Chinese|malay
Location : malaysia

http://johor.forumn.org/

Back to top Go down

Re: Image Scroll

Post by xiaomah01 on January 3rd 2012, 6:49 pm

Find a solution bounce

xiaomah01
Forumember

Male Posts : 206
Reputation : 7
Language : English|Chinese|malay
Location : malaysia

http://johor.forumn.org/

Back to top Go down

Re: Image Scroll

Post by xiaomah01 on January 4th 2012, 8:11 pm

Find a solution again bounce

xiaomah01
Forumember

Male Posts : 206
Reputation : 7
Language : English|Chinese|malay
Location : malaysia

http://johor.forumn.org/

Back to top Go down

Re: Image Scroll

Post by xiaomah01 on January 5th 2012, 5:11 pm

Find a solution againagain bounce

xiaomah01
Forumember

Male Posts : 206
Reputation : 7
Language : English|Chinese|malay
Location : malaysia

http://johor.forumn.org/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum