By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,526 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,526 IT Pros & Developers. It's quick & easy.

Highslide in Fire Fox

100+
P: 194
Hi Everybody,

im using highslide to show images. i want page scroll if the highslide is activated like window.scroll(0,550). i used this code which works good in IE but not in FF. the following is the highslide code. please tell me how and where i can use window.scroll to make scroll page and when i close the highslide then page should go back to (0,0) position this is at the top. please help me out.

here is code. this code is working perfectly but i want to scoll the page and then back to the top when highslide is closed.

here is the JS file:

Here is the HTML file:

Expand|Select|Wrap|Line Numbers
  1. <html><head>
  2. <script type="text/javascript" src="highslide/highslide-with-gallery.js"></script>
  3. <link rel="stylesheet" type="text/css" href="highslide/highslide.css" />
  4.  
  5. <script type="text/javascript">
  6.     hs.graphicsDir = 'highslide/graphics/';
  7.     hs.align = 'center';
  8.     hs.transitions = ['expand', 'crossfade'];
  9.     hs.outlineType = 'glossy-dark';
  10.     hs.wrapperClassName = 'dark';
  11.     hs.fadeInOut = true;
  12.     //hs.dimmingOpacity = 0.75;
  13.  
  14.     // Add the controlbar
  15.     if (hs.addSlideshow) hs.addSlideshow({
  16.         //slideshowGroup: 'group1',
  17.         interval: 5000,
  18.         repeat: false,
  19.         useControls: true,
  20.         fixedControls: 'fit',
  21.         overlayOptions: {
  22.             opacity: .6,
  23.             position: 'bottom center',
  24.             hideOnMouseOut: true
  25.  
  26.         }
  27.     });
  28. </script>
  29. <title></title>
  30. </head>
  31. <body>
  32.  <TABLE style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" cellSpacing=0 cellPadding=0 width=205 border=0>
  33.     <TBODY>
  34.                                 <TR>
  35.                                 <TD bgColor=#f7f7f7 
  36.                                 height=175><a href="http://bytes.com/images/print-design/full-logo/logo2(35mm).jpg" class="highslide" onClick="return hs.expand(this)"><img src="http://bytes.com/images/print-design/logo2(35mm).jpg"
  37.         title="Click to enlarge" /></a></TD>
  38.                                 </TR></TBODY></TABLE>
  39. </body></html>
im sorry i forget how to write code into its format. please i request to the administration of this site to do this for me and tell me how i can write in proper formating. thanking u.
Jan 12 '09 #1
Share this Question
Share on Google+
9 Replies


acoder
Expert Mod 15k+
P: 16,027
Use the window.scrollTo method. You can use it in the close() method.
Jan 12 '09 #2

100+
P: 194
using it in close() method means scrolling only when close method is called. i want to scroll the page when highslide is activated and then scroll back to top when it is closed. for close it is ok but how i can use window.scrollTo() when highslide is activated. thank u.
Jan 13 '09 #3

acoder
Expert Mod 15k+
P: 16,027
In that case, init() is what you're looking for.

btw, there was no need to post all of the code. A link to the source code would've been enough.
Jan 13 '09 #4

100+
P: 194
placing window.scrollTo() into init() method making scroll when page is loaded. this is what i dont want. i want to scroll it when highslide activated not initialized. plz tell me how i can do this.

thank u.
Jan 13 '09 #5

acoder
Expert Mod 15k+
P: 16,027
Check the Highslide JS API Reference - there's an onActivate event.
Jan 14 '09 #6

100+
P: 194
thank you for reference website. but im sorry i dont understand how to use hs.onActivate event there. how i can use it? would u please help me with some code? at the reference website uner onActivate event there is a little code which is defined in the head of the html page then how i can call that function? cuz im calling this <a href="images/web/full-web/web-1.gif" class="highslide" onClick="return hs.expand(this)"><img src="images/web/web-1.jpg" title="Click to enlarge" /></a> when image is clicked. please tell me. i will be grateful to you.

thank you.
Jan 14 '09 #7

acoder
Expert Mod 15k+
P: 16,027
I'm not sure what the problem is. In Highslide JS API Reference : hs.onActivate, the example is quite clear. Just add it in the head after including the highslide.js file.
Jan 14 '09 #8

100+
P: 194
im sorry im bothering you again and again. but its not working for me. like this is the head section of my html page:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="highslide/highslide-with-gallery.js"> </script>
  2. <script type="text/javascript">
  3. hs.onActivate = function() {
  4. window.scrollTo(0,550);
  5. }
  6. </script>
  7.  
  8.  
  9.  
  10. <script type="text/javascript">
  11.     hs.graphicsDir = 'highslide/graphics/';
  12.     hs.align = 'bottom';
  13.     hs.transitions = ['expand', 'crossfade'];
  14.     hs.wrapperClassName = 'dark borderless floating-caption';
  15.     hs.fadeInOut = true;
  16.     hs.dimmingOpacity = .75;
  17.  
  18.     // Add the controlbar
  19.     if (hs.addSlideshow) hs.addSlideshow({
  20.         //slideshowGroup: 'group1',
  21.         interval: 5000,
  22.         repeat: false,
  23.         useControls: true,
  24.         fixedControls: 'fit',
  25.         overlayOptions: {
  26.             opacity: .6,
  27.             position: 'bottom center',
  28.             hideOnMouseOut: true
  29.         }
  30.     });
  31.  
  32. </script>
please tell me what should i do now?

thank u.
Jan 15 '09 #9

acoder
Expert Mod 15k+
P: 16,027
So the Highslide works, but it's just the scrolling that doesn't? Try an alert on the activate event to check that it fires.

PS. please use [code] tags when posting code. You should know better now.
Jan 15 '09 #10

Post your reply

Sign in to post your reply or Sign up for a free account.