943,169 Members | Top Members by Rank

Ad:
Sep 1st, 2010
0

Scrolling of images..

Expand Post »
I want to provide sitemap with scrolling of images. I'm handling the method for scrolling image as in "Text and Image Crawler" of Dynamicdrive.com (http://www.dynamicdrive.com/dynamici...wler/index.htm). I've just changed the images and added a click event for images. The crawler.js is the same as in the "Text and Image Crawler" of Dynamicdrive.com.

In my application thing is for services, there is submenus. When the services image is clicked.. the marque movement should be paused until other than services (home, about_us, careers, contact_us) is clicked and the images of the submenu should get displayed. When other than services is clicked, the display of the submenu images must be in hide condition. IS it possible to do so. If so guide and help me.

Currently, I'd hide the submenu images by setting the property 'display:none;' for the div-id in styles.css. And when clicked i've coded to display the submenu images with javascript. But not working.

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. My html code is:
  2. *****************
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html>
  5.  
  6. <head>
  7. <meta name="GENERATOR" content="Microsoft FrontPage 6.0" />
  8. <meta name="ProgId" content="FrontPage.Editor.Document" />
  9. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
  10. <title>My Project</title>
  11. <link type="text/css" rel="stylesheet" href="css/style.css" />
  12.  
  13. <script type="text/javascript" src="js/scroll-image.js"></script>
  14. <script type="text/javascript" src="js/crawler.js"></script>
  15.  
  16. <!-- [if gte IE 7]><!-->
  17. <link type="text/css" rel="stylesheet" href="css/style-ie6.css" />
  18. <!--<![endif]-->
  19. </head>
  20.  
  21. <body style="line-height: 150%">
  22. <div>
  23.  
  24. <div style=" background:#E3E1E2; width: 766px; margin: 0px auto">
  25. <p class="body_text_heading" align=left><br>&nbsp;&nbsp;<br>&nbsp;Sitemap<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;</p>
  26. <div style=" background:#E3E1E2; width: 730px; margin: 0px auto;">
  27.  
  28. <div class="marquee" id="image_scroll">
  29. <img src="images/site_home.jpg" width="300" height="300" alt="Home" id="1_img" onclick="scrollimage('home');";/>
  30. <img src="images/site_about_us.jpg" width="300" height="300" alt="About Us" id="2_img" onclick="scrollimage('about_us');"/>
  31. <img src="images/site_careers.jpg" width="300" height="300" alt="Careers" id="3_img" onclick="scrollimage('careers');"/>
  32. <img src="images/site_services.jpg" width="300" height="300" alt="Services" id="4_img" onclick="scrollimage('services');"/>
  33. <img src="images/site_contact_us.jpg" width="300" height="300" alt="Contact Us" id="5_img" onclick="scrollimage('contact_us');"/>
  34. </div>
  35. <p class="body_text_heading" align=left><br>&nbsp;&nbsp;<br>&nbsp;<br>&nbsp;&nbsp;</p>
  36.  
  37. <script type="text/javascript">
  38. marqueeInit({
  39. uniqueid: 'image_scroll',
  40. style: {
  41. 'padding': '2px',
  42. 'width': '700px',
  43. 'height': '300px'
  44. },
  45. inc: 5, //speed - pixel increment for each iteration of this marquee's movement
  46. mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
  47. direction: 'left', // ('right' or 'left') Direction of marquee. (defaults to 'left' - easiest for reading text marquees)
  48. noAddedSpace: false, // (true or false) Should marquee not have an added space at the beginning to ensure that the first and last elements or sentences do not butt up against each other? (defaults to false (a space will be added) - optimal for text marquees and for image marquees with spaces between the images)
  49. stopped: false, // (true or false) Should marquee start out in stopped mode?, then set 'true'. Useful for some 'cursor driven' marquees. (defaults to false).
  50. // The 3 parameters below are applicable only in mouse: 'cursor driven' marquees
  51. moveatleast: 4, // Minimum speed for 'cursor driven' marquee when mouse is off of it. If not specified and this is a 'cursor driven' marquee, the marquee will stop when moused out. (defaults to no motion onmouseout)
  52. neutral: 150, // Size of neutral area for 'cursor driven' marquee. This is size of the area in the center of the marquee where hovering it will stop it. (defaults to 16)
  53. savedirection: 'true' // (true, false, or 'reverse') Directional behaviour of 'cursor driven' marquee that has a moveatleast property when moused out. Will it remember it's initial direction (true), continue it's current direction (false), or will it reverse ('reverse') its current direction? (defaults to false)
  54. });
  55. </script>
  56.  
  57. <div id="subScroll">
  58.  
  59. <div class="marquee" id="image_scroll_sub">
  60. <img src="images/site_knowledge.jpg" width="300" height="300" alt="Knowledge Transfer" id="6_img" onclick="scrollimage('knowledge');";/>
  61. <img src="images/site_business_consultancy.jpg" width="300" height="300" alt="About Us" id="7_img" onclick="scrollimage('business_consultancy');"/>
  62. <img src="images/site_hrd.jpg" width="300" height="300" alt="Careers" id="8_img" onclick="scrollimage('hrd');"/>
  63. <img src="images/site_carbon_credits.jpg" width="300" height="300" alt="Services" id="9_img" onclick="scrollimage('carbon_credits');"/>
  64. <img src="images/site_hedge.jpg" width="300" height="300" alt="Contact Us" id="10_img" onclick="scrollimage('hedge');"/>
  65. </div>
  66. <p class="body_text_heading" align=left><br>&nbsp;&nbsp;<br>&nbsp;<br>&nbsp;&nbsp;</p>
  67. <script type="text/javascript">
  68. marqueeInit({
  69. uniqueid: 'image_scroll_sub',
  70. style: {
  71. 'padding': '5px',
  72. 'width': '500px',
  73. 'height': '300px'
  74. },
  75. inc: 5, //speed - pixel increment for each iteration of this marquee's movement
  76. mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
  77. direction: 'right', // ('right' or 'left') Direction of marquee. (defaults to 'left' - easiest for reading text marquees)
  78. noAddedSpace: false, // (true or false) Should marquee not have an added space at the beginning to ensure that the first and last elements or sentences do not butt up against each other? (defaults to false (a space will be added) - optimal for text marquees and for image marquees with spaces between the images)
  79. stopped: false, // (true or false) Should marquee start out in stopped mode?, then set 'true'. Useful for some 'cursor driven' marquees. (defaults to false).
  80. // The 3 parameters below are applicable only in mouse: 'cursor driven' marquees
  81. moveatleast: 4, // Minimum speed for 'cursor driven' marquee when mouse is off of it. If not specified and this is a 'cursor driven' marquee, the marquee will stop when moused out. (defaults to no motion onmouseout)
  82. neutral: 150, // Size of neutral area for 'cursor driven' marquee. This is size of the area in the center of the marquee where hovering it will stop it. (defaults to 16)
  83. savedirection: 'true' // (true, false, or 'reverse') Directional behaviour of 'cursor driven' marquee that has a moveatleast property when moused out. Will it remember it's initial direction (true), continue it's current direction (false), or will it reverse ('reverse') its current direction? (defaults to false)
  84. });
  85. </script>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </body>
  91. </html>
  92.  
  93.  
  94. Scrollimage function within scroll-image.js
  95. *******************************************
  96. function scrollimage(getDirection){
  97. initScroll();
  98. if(getDirection=='home')
  99. {
  100.  
  101. document.getElementById('subScroll').style.display='none';
  102. alert("home");
  103.  
  104. }
  105.  
  106. if(getDirection=='about_us')
  107. {
  108.  
  109. document.getElementById('subScroll').style.display='none';
  110. alert("about_us");
  111.  
  112. }
  113.  
  114. if(getDirection=='careers')
  115. {
  116.  
  117. document.getElementById('subScroll').style.display='none';
  118. alert("careers");
  119.  
  120. }
  121.  
  122. if(getDirection=='services')
  123. {
  124. document.getElementById('subScroll').style.position='relative';
  125. document.getElementById('subScroll').style.display='inline';
  126.  
  127. alert("services");
  128.  
  129. }
  130.  
  131. if(getDirection=='contact_us')
  132. {
  133. document.getElementById('subScroll').style.display='none';
  134. alert("contact_us");
  135. }
  136.  
  137. if(getDirection=='knowledge')
  138. {
  139. document.getElementById('subScroll').style.display='inline';
  140. alert("knowledge");
  141. }
  142.  
  143. if(getDirection=='business_consultancy')
  144. {
  145. document.getElementById('subScroll').style.display='inline';
  146. alert("business_consultancy");
  147. }
  148.  
  149. if(getDirection=='hrd')
  150. {
  151. document.getElementById('subScroll').style.display='inline';
  152. alert("hrd");
  153. }
  154.  
  155. if(getDirection=='carbon_credits')
  156. {
  157. document.getElementById('subScroll').style.display='inline';
  158. alert("carbon_credits");
  159. }
  160.  
  161. if(getDirection=='hedge')
  162. {
  163. document.getElementById('subScroll').style.display='inline';
  164. alert("hedge");
  165. }
  166.  
  167.  
  168. function initScroll()
  169. {
  170. document.getElementById('subScroll').style.display='none';
  171. }
  172.  
  173.  
  174. }
  175.  
  176.  
  177.  
  178. Content of div-id(subScroll) in style.css
  179. *****************************************
  180. #subScroll
  181. {
  182. display:none;
  183. }



Scrolling of images..
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
swornavidhya_m is offline Offline
12 posts
since May 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: For Loop Won't eEecute
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: limit textfield to three words





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC