JavaScript - Help With Implementing Image Scroller Into Infowindow!
Hi, can someone please help me out with this? I've tried it a few time but couldn't get the image scroller into the infoWindow!
I want to sort of MERGE this code Code: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js" type="text/javascript"></script> <style type="text/css"> #container { text-align: center; } #imageBox{ margin: auto; width: 360px; border: 1px #000 solid; overflow: hidden; } #imageBoxInside { width: 10000px; } #imageBox img { float: left; padding: 0px; margin: 0px; } #imageBox br { clear: both; } #controls img { border: 0; } </style> <script> function moveToPrevious(){ new Effect.Move('imageBoxInside', { x: 180, y: 0, transition: Effect.Transitions.sinoidal }); } function moveToNext(){ new Effect.Move('imageBoxInside', { x: -180, y: 0, transition: Effect.Transitions.sinoidal }); } </script> </head> <body> <div id="container"> <div id="imageBox"> <div id="imageBoxInside"> <img src="C:/Users/L33508/Desktop/Images/sauce.jpg" /> <img src="C:/Users/L33508/Desktop/Images/fish.jpg" /> <img src="C:/Users/L33508/Desktop/Images/pizza.jpg" /> <img src="C:/Users/L33508/Desktop/Images/noodles.jpg" /> <img src="C:/Users/L33508/Desktop/Images/cover.jpg" /> <img src="C:/Users/L33508/Desktop/Images/hotdog.jpg" /> <br/> </div> </div> <div id="controls"> <a href="javascript:void(0);" onclick="moveToPrevious(); return true;"><img src="C:/Users/L33508/Pictures/left_arrow.jpg"/></a> <a href="javascript:void(0);" onclick="moveToNext(); return true;"><img src="C:/Users/L33508/Pictures/right_arrow.jpg"/></a> </div> <div> </body> </html> into this one shown he Code: <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.Master" CodeBehind="PeranakanMain.aspx.vb" Inherits="Peranakan_SG.PeranakanMain" title="" %> <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> <script type="text/javascript"> function addSymbol(){ var map=OneMap.map; if(map.getLayer("symbolLayer")==null){ map.addLayer(gLayer); //dojo.connect(omap.map.infoWindow, "onShow", setInfoContent); map.infoWindow.resize(525,252); map.infoWindow.setFixedAnchor(esri.dijit.InfoWindow.ANCHOR_UPPERRIGHT); } gLayer.clear(); alert("Do you know where Peranakan food can be found?? Take a look here!!!!"); var stX = "23319.3347409758"; var stY = "28825.7191286444"; var pt= new esri.geometry.Point(stX,stY,map.spatialReference); //var strImage = "http://www.rw-designer.com/i/download48b.png"; var strImage = "images/museum.png"; var symbol = new esri.symbol.PictureMarkerSymbol(strImage, 25,25); var attr = {"PlaceName":"Peranakan musem of Singapore","PlaceAddr":"addr"}; var infoTemplate = new esri.InfoTemplate(); infoTemplate.setTitle("Building Name:"); infoTemplate.setContent(getInfoContent); var graphic = new esri.Graphic(pt,symbol,attr,infoTemplate); gLayer.add(graphic); } function setInfoContent(){ infoWindow.setContent(getInfoContent()); } function getInfoContent(graphic){ var bc = new dijit.layout.BorderContainer({style: "font-size: 11pt; height: 520px; width:493px; background: #CCFFFF;"}); var c1 = new dijit.layout.ContentPane({ region: "top", style: "height: 20px width: 100%", content: "hello Peranakan!! Here is a brief description" }); bc.addChild(c1); //make a tab container var tc = new dijit.layout.TabContainer({ region: "center", style: "height: 65%; width: 100%; " }, dojo.create("div")); //display attribute information var cp1 = new dijit.layout.ContentPane({ //style: " background-color: red; ", title: "<font color= #E4287C><b>1900 - 1930</font> ", content: "<table><tr><td>Images <u>(add image)</u></td></tr></table><table><tr><td><img src='images/left_arrow.jpg'/></td><td><img src='images/batik_heritage1.jpg'/></td><td><img src='images/batik_heritage2.jpg'/></td><td><img src='images/batik_heritage3.jpg'/></td><td><img src='images/right_arrow.jpg'/></td></tr></table>" }); tc.addChild(cp1); var cp2 = new dijit.layout.ContentPane({ title: "<font color= #E4287C><b>1931 - 1960</b></font>", content: "<table><tr><td>Events <u>(add event)</u></td></tr></table><table width= 400 height = 120 ><tr><td width=150><a href='childpage1.htm' rel="nofollow" target='foo'>1970</a><br/><a href='childpage2.htm' rel="nofollow" target='foo'>1980</a></td><td><img src='images/timelineImg.jpg'/><td><iframe src='childpage1.htm' width='350' height='150' font-size='10pt' name='foo'></iframe></td></tr></table>" }); tc.addChild(cp2); var cp3 = new dijit.layout.ContentPane({ //style: " background-color: red; ", title: "<font color= #E4287C><b>1961 - 1990</b></font> ", content: "<table><tr><td>Links <u>(add link)</u></td></tr><tr><td><a href = 'http://peranakan.org.sg/'>Peranakan Association</a></td></tr><tr><td><a href='http://www.google.com.sg'>Google</a></td></tr></table>" }); tc.addChild(cp3); var cp4 = new dijit.layout.ContentPane({ //style: " background-color: red; ", title: "<font color= #E4287C><b>1990 - 2011</b></font> ", content: "<table><tr><td>Images <u>(add image)</u></td></tr></table><table><tr><td><img src='images/left_arrow.jpg'/></td><td><img src='images/batik_heritage1.jpg'/></td><td><img src='images/batik_heritage2.jpg'/></td><td><img src='images/batik_heritage3.jpg'/></td><td><img src='images/right_arrow.jpg'/></td></tr></table><br/><table><tr><td>Events <u>(add event)</u></td></tr></table><table width= 400 height = 120 ><tr><td width=150><a href='childpage1.htm' rel="nofollow" target='foo'>1970</a><br/><a href='childpage2.htm' rel="nofollow" target='foo'>1980</a></td><td><img src='images/timelineImg.jpg'/><td><iframe src='childpage1.htm' width='350' height='150' font-size='10pt' name='foo'></iframe></td></tr></table><br/><table><tr><td>Links <u>(add link)</u></td></tr><tr><td><a href = 'http://peranakan.org.sg/'>Peranakan Association</a></td></tr><tr><td><a href='http://www.google.com.sg'>Google</a></td></tr></table>" }); tc.addChild(cp4); bc.addChild(tc); return bc.domNode; } dojo.addOnLoad(addSymbol); </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="NavigationContent" runat="server"> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"> <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 955px; height: 490px; margin: 0 0 0 0px;"> <div id="map" dojotype="dijit.layout.ContentPane" region="center" position="" style="height: 498px; width: 1004px; margin-left: 63px;" ></div> </div> </div> </asp:Content> I'm still new & learning, any kind souls willing to help me out? P.S. When I insert the 2 script sources from the first sample into the second, my icon on the map disappears! Any idea why too? Similar TutorialsIs there a way to bounce my image scroller back to the left using object.watch() or something?! at the moment, it reaches the end and stops here is my code from www.dyn-web.com Code: /************************************************************************* This code is from Dynamic Web Coding at www.dyn-web.com Copyright 2001-4 by Sharon Paine See Terms of Use at www.dyn-web.com/bus/terms.html regarding conditions under which you may use this code. This notice must be retained in the code as is! *************************************************************************/ /* dw_hoverscroll.js version date: June 2004 mouseover scrolling for dw_scrollObj (in dw_scrollObj.js) */ dw_scrollObj.stopScroll = function(wnId) { if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].endScroll(); } // increase speed onmousedown of scroll links dw_scrollObj.doubleSpeed = function(wnId) { if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].speed *= 2; } dw_scrollObj.resetSpeed = function(wnId) { if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].speed /= 2; } // algorithms for time-based scrolling and scrolling onmouseover at any angle adapted from youngpup.net dw_scrollObj.initScroll = function(wnId, deg, sp) { if ( dw_scrollObjs[wnId] ) { var cosine, sine; if (typeof deg == "string") { switch (deg) { case "up" : deg = 90; break; case "down" : deg = 270; break; case "left" : deg = 180; break; case "right" : deg = 0; break; default: alert("Direction of scroll in mouseover scroll links should be 'up', 'down', 'left', 'right' or number: 0 to 360."); } } deg = deg % 360; if (deg % 90 == 0) { cosine = (deg == 0)? -1: (deg == 180)? 1: 0; sine = (deg == 90)? 1: (deg == 270)? -1: 0; } else { var angle = deg * Math.PI/180; cosine = -Math.cos(angle); sine = Math.sin(angle); } dw_scrollObjs[wnId].fx = cosine / ( Math.abs(cosine) + Math.abs(sine) ); dw_scrollObjs[wnId].fy = sine / ( Math.abs(cosine) + Math.abs(sine) ); dw_scrollObjs[wnId].endX = (deg == 90 || deg == 270)? dw_scrollObjs[wnId].x: (deg < 90 || deg > 270)? -dw_scrollObjs[wnId].maxX: 0; dw_scrollObjs[wnId].endY = (deg == 0 || deg == 180)? dw_scrollObjs[wnId].y: (deg < 180)? 0: -dw_scrollObjs[wnId].maxY; dw_scrollObjs[wnId].startScroll(sp); } } // speed (optional) to override default speed (set in dw_scrollObj.speed) dw_scrollObj.prototype.startScroll = function(speed) { if (!this.ready) return; if (this.timerId) clearInterval(this.timerId); this.speed = speed || dw_scrollObj.speed; this.lyr = document.getElementById(this.lyrId); this.lastTime = ( new Date() ).getTime(); this.on_scroll_start(); this.timerId = setInterval(this.animString + ".scroll()", 10); } dw_scrollObj.prototype.scroll = function() { var now = ( new Date() ).getTime(); var d = (now - this.lastTime)/1000 * this.speed; if (d > 0) { var x = this.x + this.fx * d; var y = this.y + this.fy * d; if (this.fx == 0 || this.fy == 0) { // for horizontal or vertical scrolling if ( ( this.fx == -1 && x > -this.maxX ) || ( this.fx == 1 && x < 0 ) || ( this.fy == -1 && y > -this.maxY ) || ( this.fy == 1 && y < 0 ) ) { this.lastTime = now; this.shiftTo(this.lyr, x, y); this.on_scroll(x, y); } else { clearInterval(this.timerId); this.timerId = 0; this.shiftTo(this.lyr, this.endX, this.endY); this.on_scroll_end(this.endX, this.endY); } } else { // for scrolling at an angle (stop when reach end on one axis) if ( ( this.fx < 0 && x >= -this.maxX && this.fy < 0 && y >= -this.maxY ) || ( this.fx > 0 && x <= 0 && this.fy > 0 && y <= 0 ) || ( this.fx < 0 && x >= -this.maxX && this.fy > 0 && y <= 0 ) || ( this.fx > 0 && x <= 0 && this.fy < 0 && y >= -this.maxY ) ) { this.lastTime = now; this.shiftTo(this.lyr, x, y); this.on_scroll(x, y); } else { clearInterval(this.timerId); this.timerId = 0; this.on_scroll_end(this.x, this.y); } } } } dw_scrollObj.prototype.endScroll = function() { if (!this.ready) return; if (this.timerId) clearInterval(this.timerId); this.timerId = 0; this.lyr = null; } dw_scrollObj.prototype.on_scroll = function() {} dw_scrollObj.prototype.on_scroll_start = function() {} dw_scrollObj.prototype.on_scroll_end = function() {} I want these images to center align when they have focus (clicked, enlarge), can't figure out how to move them over from the right. js file attached. Some .css may come into play here also, but I think this animation issue is all .js. http://backstageweb.net/MovingBoxes/ Thanks, John Hi guys, I am a new poster and new to google maps. I have been working on geocoding and I have a problem, the example below works fine, all rollovers and icons work perfectly. However, the info window will only display for one point. I am assuming I have this line of code in the wrong place. new google.maps.event.addListener(marker, 'click', function() {infowindow.open(map,marker);}); Can anyone please help me? I would be so appriciative. Code: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> /** * Data for the markers consisting of a name, a LatLng and a zIndex for * the order in which these markers should display on top of each * other. */ var MarkersArray = [ ['Oceans Eleven Casino', 33.199931,-117.368917, 4, '<div id="">Oceans Eleven Casino - text</div>', 'images/search.chips.small.png'], ['Pala Casino & Resort', 33.359418,-117.10583, 5, '<div id="content">Pala Casino & Resort - text</div>', 'images/search.chips.png'], ['Casino Pauma', 33.333271,-116.990626, 3, '<div id="content">Casino Pauma - text</div>', 'images/search.chips.small.png'], ['Lucky Lady Casino', 32.75844,-117.075513, 2, '<div id="content">Lucky Lady Casino - text</div>', 'images/search.chips.small.png'], ['Palomar Club', 32.75542,-117.13433, 1, 'Palomar Club - text', 'images/search.chips.png'] ]; function setMarkers(map, locations) { // Add markers to the map for (var i = 0; i < locations.length; i++) { var MarkersArray = locations[i]; // Marker sizes are expressed as a Size of X,Y var image = new google.maps.MarkerImage(MarkersArray[5], // This marker is 20 pixels wide by 32 pixels tall. new google.maps.Size(60, 50), // The origin for this image is 0,0. new google.maps.Point(0,0), // The anchor for this image is the base of the flagpole at 0,32. new google.maps.Point(0, 33)); var shadow = new google.maps.MarkerImage(MarkersArray[5], // The shadow image is larger in the horizontal dimension // while the position and offset are the same as for the main image. new google.maps.Size(75, 60), new google.maps.Point(0,0), new google.maps.Point(0, 33)); // Shapes define the clickable region of the icon. var shape = { coord: [0,0,1,54,59,54,59,0], type: 'poly' }; var infowindow = new google.maps.InfoWindow({content: MarkersArray[4]}); var myLatLng = new google.maps.LatLng(MarkersArray[1], MarkersArray[2]); var marker = new google.maps.Marker({position: myLatLng,map: map,shadow: shadow,icon: image,shape: shape,title: MarkersArray[0],zIndex: MarkersArray[3]}); } new google.maps.event.addListener(marker, 'click', function() {infowindow.open(map,marker);}); } function initialize() { var myOptions = { zoom: 10, center: new google.maps.LatLng(32.75542,-117.13433), mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); setMarkers(map, MarkersArray); } </script> How to fix a infowindow or a info template to a point so that when i drag the map the infowindow will no change place or move ...what is the code...and where shld i place it at? this is my code : var stX = "23319.3347409758"; var stY = "28825.7191286444"; var pt= new esri.geometry.Point(stX,stY,map.spatialReference); //var strImage = "http://www.rw-designer.com/i/download48b.png"; var symbol = new esri.symbol.PictureMarkerSymbol(strImage, 25,25); var attr = {"PlaceName":"Peranakan musem of Singapore","PlaceAddr":"addr"}; var infoTemplate = new esri.InfoTemplate(); infoTemplate.setTitle("Building Name:"); infoTemplate.setContent(getInfoContent); var graphic = new esri.Graphic(pt,symbol,attr,infoTemplate); gLayer.add(graphic); } function getInfoContent(graphic){ var bc = new dijit.layout.BorderContainer({style: "font-size: 11pt; height: 520px; width:493px; background: #CCFFFF;"}); var c1 = new dijit.layout.ContentPane({ region: "top", style: "height: 20px width: 100%", content: "hello" }); bc.addChild(c1); //make a tab container var tc = new dijit.layout.TabContainer({ region: "center", style: "height: 65%; width: 100%; " }, dojo.create("div")); //display attribute information var cp1 = new dijit.layout.ContentPane({ //style: " background-color: red; ", title: "<font color= #E4287C><b>detail</font> ", content: "sfdfsdfsdf" }); tc.addChild(cp1); bc.addChild(tc); return bc.domNode; } dojo.addOnLoad(addSymbol); Based on a selected country and date a list of results will show up on the map. The placements of markers with html data in them works fine, the problem I have is handling the cases with duplicate markers. I found a way to check for duplicate ones, but I would like to be able to modify the content in the infowindow of the one already present. So that I can add the content of the duplicate marker to the existing marker that stands in the same location. The problem I'm having is that I can't find the right way to access the data in the existing infowindow for the duplicate one. If I do alert(infoWindow.getContent());, then I just get "undefined". I also tried markers[i].getContent(), but that also didn't do anything. Any idea's, or suggestion on how I can access the infowindows of previously added markers, get their content with getContent(), and add the data of the duplicate one to it? Code: var marker = new google.maps.Marker({ map: map, position: latlng }); for (var i=0; i<markers.length; i++) { if (markers[i].getPosition().equals(marker.getPosition())) { alert('duplicate found'); alert(infoWindow.getContent()); } else { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); } } Hey guys, I am trying to put this code on a test website (below). How do I get it so that when I preview in browser, the javascript activates because at the moment it just shows a blank page. I have tried putting it in the <javascript> / <script> tags but nothing. Any advice appreciated var input = prompt("Insert Number"); for (i=1; i<=input; i++) { if (i % 3 === 0 && i % 5 === 0) { console.log("FizzBuzz"); } else if (i % 3 === 0) { console.log("Fizz"); } else if (i % 5 === 0) { console.log("Buzz"); } else { console.log(i); } Just trying to get a feel working with javascript, HTML and CSS. I've got a code. I've listed it below. The only question I have which I am sure I'm just overlooking it, but I need to find a way to squeeze this to the top of the screen and to the left. Where can I modify this on this code? The first section is the whole file. Thanks! Edit: I'm trying to remove the awkward gap on top and to the left. I merged the .js file since this will only be a file that is updated with new news. Code: <html> <head> <script type="text/javascript"> /* Text and/or Image Crawler Script v1.5 (c)2009-2011 John Davenport Scheuer as first seen in http://www.dynamicdrive.com/forums/ username: jscheuer1 - This Notice Must Remain for Legal Use updated: 4/2011 for random order option, more (see below) */ /* Update 4/2011 to v1.5 - Adds optional random property. Set it to true to use. Fixes browser crash from empty crawlers, ad and image blocking software/routines. Fixes behavior in some IE of breaking script if an image is missing. Adds alt attributes to images without them to aid in diagnosis of missing/corrupt images. This may be disabled with the new optional noAddedAlt property set to true. Internal workings enhanced for greater speed of execution, less memory usage. */ ///////////////// No Need to Edit - Configuration is Done in the On Page Call(s) ///////////////// function marqueeInit(config){ if(!document.createElement) return; marqueeInit.ar.push(config); marqueeInit.run(config.uniqueid); } (function(){ if(!document.createElement) return; marqueeInit.ar = []; document.write('<style type="text/css">.marquee{white-space:nowrap;overflow:hidden;visibility:hidden;}' + '#marq_kill_marg_bord{border:none!important;margin:0!important;}<\/style>'); var c = 0, tTRE = [/^\s*$/, /^\s*/, /\s*$/, /[^\/]+$/], req1 = {'position': 'relative', 'overflow': 'hidden'}, defaultconfig = { style: { //default style object for marquee containers without configured style 'margin': '0 auto' }, direction: 'left', inc: 2, //default speed - pixel increment for each iteration of a marquee's movement mouse: 'pause' //default mouseover behavior ('pause' 'cursor driven' or false) }, dash, ie = false, oldie = 0, ie5 = false, iever = 0; /*@cc_on @*/ /*@if(@_jscript_version >= 5) ie = true; try{document.documentMode = 2000}catch(e){}; iever = Math.min(document.documentMode, navigator.appVersion.replace(/^.*MSIE (\d+\.\d+).*$/, '$1')); if(iever < 6) oldie = 1; if(iever < 5.5){ Array.prototype.push = function(el){this[this.length] = el;}; ie5 = true; dash = /(-(.))/; String.prototype.encamel = function(s, m){ s = this; while((m = dash.exec(s))) s = s.replace(m[1], m[2].toUpperCase()); return s; }; } @end @*/ if(!ie5){ dash = /-(.)/g; function toHump(a, b){return b.toUpperCase();}; String.prototype.encamel = function(){return this.replace(dash, toHump);}; } if(ie && iever < 8){ marqueeInit.table = []; window.attachEvent('onload', function(){ marqueeInit.OK = true; for(var i = 0; i < marqueeInit.table.length; ++i) marqueeInit.run(marqueeInit.table[i]); }); } function intable(el){ while((el = el.parentNode)) if(el.tagName && el.tagName.toLowerCase() === 'table') return true; return false; }; marqueeInit.run = function(id){ if(ie && !marqueeInit.OK && iever < 8 && intable(document.getElementById(id))){ marqueeInit.table.push(id); return; } if(!document.getElementById(id)) setTimeout(function(){marqueeInit.run(id);}, 300); else new Marq(c++, document.getElementById(id)); } function trimTags(tag){ var r = [], i = 0, e; while((e = tag.firstChild) && e.nodeType === 3 && tTRE[0].test(e.nodeValue)) tag.removeChild(e); while((e = tag.lastChild) && e.nodeType === 3 && tTRE[0].test(e.nodeValue)) tag.removeChild(e); if((e = tag.firstChild) && e.nodeType === 3) e.nodeValue = e.nodeValue.replace(tTRE[1], ''); if((e = tag.lastChild) && e.nodeType === 3) e.nodeValue = e.nodeValue.replace(tTRE[2], ''); while((e = tag.firstChild)) r[i++] = tag.removeChild(e); return r; } function randthem(tag){ var els = oldie? tag.all : tag.getElementsByTagName('*'), i = els.length - 1, childels = [], newels = []; for (i; i > -1; --i){ if(els[i].parentNode === tag){ childels.push(els[i]); newels.push(els[i].cloneNode(true)); } } newels.sort(function(){return 0.5 - Math.random();}); i = childels.length - 1; for (i; i > -1; --i){ tag.replaceChild(newels[i], childels[i]); } } function Marq(c, tag){ var p, u, s, a, ims, ic, i, marqContent, cObj = this; this.mq = marqueeInit.ar[c]; if(this.mq.random){ randthem(tag); } for (p in defaultconfig) if((this.mq.hasOwnProperty && !this.mq.hasOwnProperty(p)) || (!this.mq.hasOwnProperty && !this.mq[p])) this.mq[p] = defaultconfig[p]; this.mq.style.width = !this.mq.style.width || isNaN(parseInt(this.mq.style.width))? '100%' : this.mq.style.width; if(!tag.getElementsByTagName('img')[0]) this.mq.style.height = !this.mq.style.height || isNaN(parseInt(this.mq.style.height))? tag.offsetHeight + 3 + 'px' : this.mq.style.height; else this.mq.style.height = !this.mq.style.height || isNaN(parseInt(this.mq.style.height))? 'auto' : this.mq.style.height; u = this.mq.style.width.split(/\d/); this.cw = this.mq.style.width? [parseInt(this.mq.style.width), u[u.length - 1]] : ['a']; marqContent = trimTags(tag); tag.className = tag.id = ''; tag.removeAttribute('class', 0); tag.removeAttribute('id', 0); if(ie) tag.removeAttribute('className', 0); tag.appendChild(tag.cloneNode(false)); tag.className = ['marquee', c].join(''); tag.style.overflow = 'hidden'; this.c = tag.firstChild; this.c.appendChild(this.c.cloneNode(false)); this.c.style.visibility = 'hidden'; a = [[req1, this.c.style], [this.mq.style, this.c.style]]; for (i = a.length - 1; i > -1; --i) for (p in a[i][0]) if((a[i][0].hasOwnProperty && a[i][0].hasOwnProperty(p)) || (!a[i][0].hasOwnProperty)) a[i][1][p.encamel()] = a[i][0][p]; this.m = this.c.firstChild; if(this.mq.mouse === 'pause'){ this.c.onmouseover = function(){cObj.mq.stopped = true;}; this.c.onmouseout = function(){cObj.mq.stopped = false;}; } this.m.style.position = 'absolute'; this.m.style.left = '-10000000px'; this.m.style.whiteSpace = 'nowrap'; if(ie5) this.c.firstChild.appendChild((this.m = document.createElement('nobr'))); if(!this.mq.noAddedSpace) this.m.appendChild(document.createTextNode('\xa0')); for(i = 0; marqContent[i]; ++i) this.m.appendChild(marqContent[i]); if(ie5) this.m = this.c.firstChild; ims = this.m.getElementsByTagName('img'); if(ims.length){ for(ic = 0, i = 0; i < ims.length; ++i){ ims[i].style.display = 'inline'; if(!ims[i].alt && !this.mq.noAddedAlt){ ims[i].alt = (tTRE[3].exec(ims[i].src)) || ('Image #' + [i + 1]); if(!ims[i].title){ims[i].title = '';} } ims[i].style.display = 'inline'; ims[i].style.verticalAlign = ims[i].style.verticalAlign || 'top'; if(typeof ims[i].complete === 'boolean' && ims[i].complete) ic++; else { ims[i].onload = ims[i].onerror = function(){ if(++ic === ims.length) cObj.setup(c); }; } if(ic === ims.length) this.setup(c); } } else this.setup(c) } Marq.prototype.setup = function(c){ if(this.mq.setup) return; this.mq.setup = this; var s, w, cObj = this, exit = 10000; if(this.c.style.height === 'auto') this.c.style.height = this.m.offsetHeight + 4 + 'px'; this.c.appendChild(this.m.cloneNode(true)); this.m = [this.m, this.m.nextSibling]; if(this.mq.mouse === 'cursor driven'){ this.r = this.mq.neutral || 16; this.sinc = this.mq.inc; this.c.onmousemove = function(e){cObj.mq.stopped = false; cObj.directspeed(e)}; if(this.mq.moveatleast){ this.mq.inc = this.mq.moveatleast; if(this.mq.savedirection){ if(this.mq.savedirection === 'reverse'){ this.c.onmouseout = function(e){ if(cObj.contains(e)) return; cObj.mq.inc = cObj.mq.moveatleast; cObj.mq.direction = cObj.mq.direction === 'right'? 'left' : 'right';}; } else { this.mq.savedirection = this.mq.direction; this.c.onmouseout = function(e){ if(cObj.contains(e)) return; cObj.mq.inc = cObj.mq.moveatleast; cObj.mq.direction = cObj.mq.savedirection;}; } } else this.c.onmouseout = function(e){if(!cObj.contains(e)) cObj.mq.inc = cObj.mq.moveatleast;}; } else this.c.onmouseout = function(e){if(!cObj.contains(e)) cObj.slowdeath();}; } this.w = this.m[0].offsetWidth; this.m[0].style.left = 0; this.c.id = 'marq_kill_marg_bord'; this.m[0].style.top = this.m[1].style.top = Math.floor((this.c.offsetHeight - this.m[0].offsetHeight) / 2 - oldie) + 'px'; this.c.id = ''; this.c.removeAttribute('id', 0); this.m[1].style.left = this.w + 'px'; s = this.mq.moveatleast? Math.max(this.mq.moveatleast, this.sinc) : (this.sinc || this.mq.inc); while(this.c.offsetWidth > this.w - s && --exit){ w = isNaN(this.cw[0])? this.w - s : --this.cw[0]; if(w < 1 || this.w < Math.max(1, s)){break;} this.c.style.width = isNaN(this.cw[0])? this.w - s + 'px' : --this.cw[0] + this.cw[1]; } this.c.style.visibility = 'visible'; this.runit(); } Marq.prototype.slowdeath = function(){ var cObj = this; if(this.mq.inc){ this.mq.inc -= 1; this.timer = setTimeout(function(){cObj.slowdeath();}, 100); } } Marq.prototype.runit = function(){ var cObj = this, d = this.mq.direction === 'right'? 1 : -1; if(this.mq.stopped || this.mq.stopMarquee){ setTimeout(function(){cObj.runit();}, 300); return; } if(this.mq.mouse != 'cursor driven') this.mq.inc = Math.max(1, this.mq.inc); if(d * parseInt(this.m[0].style.left) >= this.w) this.m[0].style.left = parseInt(this.m[1].style.left) - d * this.w + 'px'; if(d * parseInt(this.m[1].style.left) >= this.w) this.m[1].style.left = parseInt(this.m[0].style.left) - d * this.w + 'px'; this.m[0].style.left = parseInt(this.m[0].style.left) + d * this.mq.inc + 'px'; this.m[1].style.left = parseInt(this.m[1].style.left) + d * this.mq.inc + 'px'; setTimeout(function(){cObj.runit();}, 30 + (this.mq.addDelay || 0)); } Marq.prototype.directspeed = function(e){ e = e || window.event; if(this.timer) clearTimeout(this.timer); var c = this.c, w = c.offsetWidth, l = c.offsetLeft, mp = (typeof e.pageX === 'number'? e.pageX : e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft) - l, lb = (w - this.r) / 2, rb = (w + this.r) / 2; while((c = c.offsetParent)) mp -= c.offsetLeft; this.mq.direction = mp > rb? 'left' : 'right'; this.mq.inc = Math.round((mp > rb? (mp - rb) : mp < lb? (lb - mp) : 0) / lb * this.sinc); } Marq.prototype.contains = function(e){ if(e && e.relatedTarget){var c = e.relatedTarget; if(c === this.c) return true; while ((c = c.parentNode)) if(c === this.c) return true;} return false; } function resize(){ for(var s, w, m, i = 0; i < marqueeInit.ar.length; ++i){ if(marqueeInit.ar[i] && marqueeInit.ar[i].setup){ m = marqueeInit.ar[i].setup; s = m.mq.moveatleast? Math.max(m.mq.moveatleast, m.sinc) : (m.sinc || m.mq.inc); m.c.style.width = m.mq.style.width; m.cw[0] = m.cw.length > 1? parseInt(m.mq.style.width) : 'a'; while(m.c.offsetWidth > m.w - s){ w = isNaN(m.cw[0])? m.w - s : --m.cw[0]; if(w < 1){break;} m.c.style.width = isNaN(m.cw[0])? m.w - s + 'px' : --m.cw[0] + m.cw[1]; } } } } if (window.addEventListener) window.addEventListener('resize', resize, false); else if (window.attachEvent) window.attachEvent('onresize', resize); })(); /* Text and/or Image Crawler Script v1.5 (c)2009-2011 John Davenport Scheuer as first seen in http://www.dynamicdrive.com/forums/ username: jscheuer1 - This Notice Must Remain for Legal Use updated: 4/2011 for random order option, more (see below) */ </script> </head> <body> <font color="white" face="arial" size="2" background="#0066CC"> <div class="marquee" id="mycrawler" align="left"> 2/21/12 Today is testing the marquee. This will be used for announcements. Stay tuned!!!                         </div></font> <script type="text/javascript"> marqueeInit({ uniqueid: 'mycrawler', style: { 'padding': '1px', 'width': '1000px', //change to 1000 for normal, change to 0 for off 'background': '#0066CC', 'border': '0px solid black' }, inc: 1, //speed - pixel increment for each iteration of this marquee's movement mouse: 'false', //mouseover behavior ('pause' 'cursor driven' or false) moveatleast: 1, neutral: 150, savedirection: true }); </script> </body> </html> I am using a Theme Tester on my site so normal users can not see the changes being made. If you can help me, please send me a PM & I will give you a temporary login so you can login & see the new site, and the issue I am having. Basically, I am trying to get this http://flowplayer.org/tools/demos/sc.../navigator.htm scroller to work, but it is not happening at all. Not sure what is going on. Please advise. Thanks! Hi I have a javascript scroller on my site which was added automatically by the web design progam Web Page Maker. It works well..... but..... does anybody know how to make the scrolling faster on mousedown. Its painfully slow at the moment. I dont know ANYTHING about javascripting really. heres the code: <div id="g_iFrame1div" style="position:absolute; left:68px; top:273px; z-index:29"> <table border="0" cellpadding="0" cellspacing="0" width=628> <tr><td> <iframe src="iframes/news_latest.htm" name="g_iFrame1" width="606" height="487" src="" scrolling="no" frameborder="0"></iframe> </td><td align="center" valign="middle" width="22"><img src="arrow_up.gif" alt="up" border=0 vspace="5" hspace="3" onMouseDown="esh_g_iFrame1();bsh_g_iFrame1(-3,2)" onMouseUp="esh_g_iFrame1();bsh_g_iFrame1(-1,20)" onMouseOver="bsh_g_iFrame1(-1,20)" onMouseOut="esh_g_iFrame1()"><br> <img src="arrow_down.gif" alt="down" border=0 vspace="5" hspace="3" onMouseDown="esh_g_iFrame1();bsh_g_iFrame1(3,2)" onMouseUp="esh_g_iFrame1();bsh_g_iFrame1(1,20)" onMouseOver="bsh_g_iFrame1(1,20)" onMouseOut="esh_g_iFrame1()"> <script type="text/javascript" language="javascript"> function bsh_g_iFrame1(step,time){hs_g_iFrame1=setInterval("sh_g_iFrame1("+step+")",time)} function esh_g_iFrame1(){clearInterval(hs_g_iFrame1)} function sh_g_iFrame1(step) { scrollx=g_iFrame1.document.body.scrollLeft scrolly=g_iFrame1.document.body.scrollTop scrolly=scrolly+step g_iFrame1.window.scroll(scrollx,scrolly) } </script> thanks Stuey Hi All, Hoping somebody can help me with my implementation of the Nivo Slideshow on my website... I've been at it for a couple of days now and I'm just about ready to give up ( Here's my markup: Code: <div id="slider"> <img src="/images/Slide1.png" alt="" title="Dead Kool"/> <a href="http://dev7studios.com"><img src="/images/Slide2.png" alt="" title="Alex Kidd" /></a> <img src="/images/Slide3.png" alt="" title="Asteroids" /> </div> My CSS: Code: #slider { position:relative; width:620px; height:350px; background-image:url(../images/title.gif); background-position:-10px 30px; background-repeat:no-repeat; background-attachment:fixed; } #slider img { position:absolute; top:0px; left:0px; display:none; } #slider a { border:0; display:block; } .nivo-controlNav { position:absolute; left:260px; bottom:-42px; } .nivo-controlNav a { display:block; width:22px; height:22px; background:url(images/bullets.png) no-repeat; text-indent:-9999px; border:0; margin-right:3px; float:left; } .nivo-controlNav a.active { background-position:0 -22px; } .nivo-directionNav a { display:block; width:30px; height:30px; background:url(images/arrows.png) no-repeat; text-indent:-9999px; border:0; } a.nivo-nextNav { background-position:-30px 0; right:15px; } a.nivo-prevNav { left:15px; } .nivo-caption { font-family:"Lucida Sans Unicode", "Lucida Grande"; } .nivo-caption a { color:#f71cac; text-decoration:underline; } Slider CSS: Code: /* * jQuery Nivo Slider v2.3 * http://nivo.dev7studios.com * * Copyright 2010, Gilbert Pellegrom * Free to use and abuse under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * March 2010 */ /* The Nivo Slider styles */ .nivoSlider { position:relative; } .nivoSlider img { position:absolute; top:0px; left:0px; } /* If an image is wrapped in a link */ .nivoSlider a.nivo-imageLink { position:absolute; top:0px; left:0px; width:100%; height:100%; border:0; padding:0; margin:0; z-index:60; display:none; } /* The slices in the Slider */ .nivo-slice { display:block; position:absolute; z-index:50; height:100%; } /* Caption styles */ .nivo-caption { position:absolute; left:0px; bottom:0px; background:#000; color:#fff; opacity:0.8; /* Overridden by captionOpacity setting */ width:100%; z-index:89; } .nivo-caption p { padding:5px; margin:0; } .nivo-caption a { display:inline; } .nivo-html-caption { display:none; } /* Direction nav styles (e.g. Next & Prev) */ .nivo-directionNav a { position:absolute; top:45%; z-index:99; cursor:pointer; } .nivo-prevNav { left:0px; } .nivo-nextNav { right:0px; } /* Control nav styles (e.g. 1,2,3...) */ .nivo-controlNav a { position:relative; z-index:99; cursor:pointer; } .nivo-controlNav a.active { font-weight:bold; } The test site is here http://www.koolkiddclothing.com/Test I feel like I'm being dumb, but for some reason I just can't get it to work, so any help is good help... I'm trying to do what they are saying at this link: http://blogs.sitepoint.com/perfect-pop-up/ First, they tell me to do what is listed under the "Scripting Disabled" section: <a href="file.htm" onclick="window.open('file.htm'); <br> return false;" rel="nofollow" target="newWin"> Then, down in the page in the "The Perfect Pop-Up Script" section it has a large script for me to use. I'm wanting to use it at my page http://www.best-stock-trading-system...ng-system.html I want to make each of my images pop up windows like at this site: http://www.polyvore.com/cgi/shop?query=shoes So, are they telling me to use the html in both sections? Where would I put the html in the top section vs. the script in the lower section? Do I have to make another webpage and just paste the script in there and then call it, like they say below: "To call the function you would use the following code:" <a href="my-pop-up-window.htm" <br> onclick="popUp(this.href,'console',400,200);return false;" <br> rel="nofollow" target="_blank">This is my link</a> I'm a bit confused where I am supposed to inserting the page name for the popup that I want to pop up vs inserting the pagename for the script page that I guess I have to make. So what are the steps that I would take to do all of this?! Thank you for your help! Hi, does anyone know how to make a very simple jQuery vertical carousel? without having to use the plugin...
Does anyone have a scroller that goes side to side, to display links for a website? I have a similar thing that goes up and down: www.sjwum.org This one will not adapt to side to side. So who knows of a scroller that moves horizontally and when you click on something it is a link to another page on the website? Thanks I need to make a very simple text scroller (either vertical or horizontal) using JavaScript. Can anyone point me in the right direction? Thank you Hello, i'm trying to post news on my site. so i was able to reached this http://www.shmtestforums.uphero.com/...ller/test.html but i couldn't get, exactly what i want. i really want is when load the page it should shows only 3 rows then after few seconds(say 2 seconds), the 1st row should disappear and bellow 3 rows should come up (eg. when google_1 row is disappear, google_2 & google_3 & google_4 rows should come up) this rotation should be continuous i tried this many. but no positive result. so please.... please....help me to solve this. this is the problematic java script, Code: <script type="text/javascript"> var scrollspeed=cache=1 var initialdelay=500 function initializeScroller(){ dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer") dataobj.style.top="5px" setTimeout("getdataheight()", initialdelay) } function getdataheight(){ thelength=dataobj.offsetHeight if (thelength==0) setTimeout("getdataheight()",10) else scrollDiv() } function scrollDiv(){ dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px" if (parseInt(dataobj.style.top)<thelength*(-1)) dataobj.style.top="5px" setTimeout("scrollDiv()",40) } if (window.addEventListener) window.addEventListener("load", initializeScroller, false) else if (window.attachEvent) window.attachEvent("onload", initializeScroller) else window.onload=initializeScroller </script> thank you . Hi All, I am trying to introduce a vertical scroller to my site, I got the code from a tutorial and slightly tweaked the html to meet my needs but now the content doesn't scroll. Would someone be willing to take a quick look and see if they can spot anything? None of this code has been altered! Code: <script type="text/javascript"> $(document).ready(function(){ $(".newsticker-jcarousellite").jCarouselLite({ vertical: true, hoverPause:true, visible:10, auto:500, speed:1000 }); }); </script> This is the HTML and PHP part: Code: <div id="newsticker-demo"> <div class="newsticker-jcarousellite"> <br/> <?php $query = mysql_query("SELECT * FROM employers WHERE featured = 'Yes' AND image != '' ORDER BY rand()"); $i=0; //$query = mysql_query("SELECT * FROM employers WHERE f_emp_active = 'Yes' and image !='' ORDER BY rand()"); echo '<div>'; while ($aqm=mysql_fetch_array($query)){ ?> <div> <div> <div class="thumbnail"> <div align="center"><a href="company.php?companyname=<?php echo $string ?>"> <img src="<?=$fullurl?>/thumbnail.php?gd=2&src=employers/logo/big/<?=$aqm[image]?>&maxw=<?=$a18[width]?>" alt="<?=$aqm[companyname]?>" title="<?=$aqm[companyname]?>" class="noborder" /></a> </div> </div> <div class="clear"></div> </div> </div> <br/> <br/> <?php if($i==5){ echo '</div><div>'; } $i++; } echo '</div>'; ?> </div> </div> I can't seem to find what I need but I know it exists. I trying to find a vertical scroller that will automatically have the text scroll upwards but have an arrow above and arrow below to be able to control the direction of the scrolling text, or a script with no arrows but still allow me to take control by mousing over the text to scroll up or down. Thanks Would anyone know why (and the fix) when I place my cursor over the scrolling thumbnails under the main slideshow rotator on my site they "disappear"? http://americanwebmakers.com/demo_college Thanks in advance! Hey fellow coders. I've been searching for a script, but I'm coming up empty. The script will display products in a single row full screen left to right. To slide the products there is a pull bar. You can see how the exact script works on http://www.logitech.com/en-us/keyboards/keyboards. Does anybody know of a complete script, or at least one that is close enough to alter. Thanks much.
|