JavaScript - Mootools Advice Needed Urgently
Hi All,
I am looking to build a gallery similar to this one: http://www.designguru.co.za/pages/brand.php I am new to MooTools and don't know where to start, which plug ins etc.. Can anyone help me or just point me in the right directions Thanks in advance Similar TutorialsI'm currently trying to make a contact form using mootools FormCheck and mootools Form.Send in conjunction with each other. Each one will function correctly individually, but once I have all three: mootools.js (required by form.send) mootools-more.js (required by FormCheck) mootools-core.js (required by FormCheck) linked in my header, the form.send becomes dominant and my formcheck doesn't function at all. I'm specifically using form.send so that I can post a success (or failure) message without reloading the contact page. I'm using FormCheck - obviously to check that required fields are filled out. I have stripped the form from the website itself here. and here are the two pieces of code I'm using: FormCheck Code: <script type="text/javascript"> window.addEvent('domready', function(){ new FormCheck('myform'); }); </script> Form.Send Code: <script type="text/javascript"> var fx = { 'loading': new Fx.Style( 'loading', 'opacity',{ duration: 400 } ), 'success': new Fx.Style( 'success', 'opacity',{ duration: 400 } ), 'fail': new Fx.Style( 'fail', 'opacity',{ duration: 400 } ) }; var showHide = function( el ){ fx.loading.set(0); (fx[ el ]).start(0,1); (function(){ (fx[ el ]).start(1,0); }).delay( 20000 ); } $('submit').addEvent( 'click', function(evt){ new Event(evt).stop(); $('myform').send({ onRequest: function(){ fx.loading.start( 1,0 ); }, onSuccess: function(){ showHide( 'success' ); }, onFailu function(){ showHide( 'fail' ); } }); } ); </script> I have no idea what I'm doing with javascript, but I imagine I need a line that tells the script if FormCheck is successful, run Form.Send ? Anything would help at this point. --Eric Hi all, I have found a nice mootools script and it's using the 1.2.4 version of mootools. The problem is that my website is already using the 1.12 version. Is it possible to change the code and make it compatible with 1.12? My knowledge in javascript is poor and I can't spot the changes that need to be done here. Can you help me please? Code: window.addEvent('domready',function() { (function($) { /* for keeping track of what's "open" */ var activeClass = 'dropdown-active', showingDropdown, showingMenu, showingParent; /* hides the current menu */ var hideMenu = function() { if(showingDropdown) { showingDropdown.removeClass(activeClass); showingMenu.setStyle('display','none'); } }; /* recurse through dropdown menus */ $$('.dropdown').each(function(dropdown) { /* track elements: menu, parent */ var menu = dropdown.getNext('div.dropdown-menu'), parent = dropdown.getParent('div'); /* function that shows THIS menu */ var showMenu = function() { hideMenu(); showingDropdown = dropdown.addClass('dropdown-active'); showingMenu = menu.setStyle('display','block'); showingParent = parent; }; /* function to show menu when clicked */ dropdown.addEvent('click',function(e) { if(e) e.stop(); showMenu(); }); /* function to show menu when someone tabs to the box */ dropdown.addEvent('focus',function() { showMenu(); }); }); $$('#close').addEvent('click',function(e) { hideMenu(); }); })(document.id); }); I found a menu I really like at the top of the page at www-dot-sachscreative-dot-com but can't figure out how it works from the source code. Can someone tell me how to make something like it which is browser independent and uses javascript and/or CSS? It's been years since I did javascript work and I've forgotten must of what I used to know. Thanks.
Hi there, am working on an assignment to replicate the caesar cipher. i've written a function to move the cipher text one postion to the right and it works. i'm now trying to write another function that calls on the first where the signal character and index character do not match. The function then returns a new array. Here is the first function and it's test call: Code: function right(letterArray) { var lowerArray = new Array(letterArray.length); for (var letter = 0; letter < letterArray.length; letter = letter + 1) { lowerArray[letter] = letterArray[letter - 1]; if(letter == letterArray.length - 1) { lowerArray[0] = letterArray[letterArray.length - 1]; } } return lowerArray; } function testTask02() { right(cipherArray) window.alert(right(cipherArray)); // calls the right() function with cipherArray, an array of lower case // characters as an argument. // displays the return value in a dialogue box. } And here is the bit i'm having trouble with: Code: function rotateToPosition(signalCharacter, indexCharacter, plainAlphabet, cipherAlphabet) { var resultArray = new Array(cipherAlphabet.length); for (var copy = 0; copy < cipherAlphabet.length; copy = copy + 1) { resultArray[copy] = cipherAlphabet[copy]; resultArray[indexCharacter] = resultArray[copy]; } var signalPosition = signalCharacter; for (var position = 1; position < plainAlphabet.length; position = position + 1) { if (plainAlphabet[position] == plainAlphabet[signalPosition]) { signalPosition = position; } } while (resultArray[indexCharacter] != plainAlphabet[signalPosition]) { right(resultArray); } return resultArray; } function testTask03() { rotateToPosition('A', 'g', plainArray, cipherArray) window.alert(rotateToPosition('A', 'g', plainArray, cipherArray)); // calls the rotateToPosition() function with signal character, // index character, an array of upper case letters and an // array of locwer case letters as arguments. // displays the return value in a dialogue box //TO DO TASK 3 (iii) } Been working on this for hours and my brain is fried! If anyone can point me in the right direction that would be awesome. Many thanks Hi, I'm trying to build this site that has an accordion styled navigation but there's one little issue. As each div is resizing, they're jittering (take a look at the site: http://balancehair.matcamp.com/) The code I'm using to achieve it is as follows: Code: var all_fields = new Array('home','about','services','gallery','promos','contact'); function hoverRun(fieldName) { for(var t=0;t<all_fields.length;t++) { if(all_fields[t]!=fieldName) { $('box_'+all_fields[t]).style.backgroundImage = 'url(/images/img_'+all_fields[t]+'_inactive.jpg)'; $('tab_'+all_fields[t]).src = '/images/tab_inactive.png'; $('text_'+all_fields[t]).src = '/images/tab_'+all_fields[t]+'_inactive.png'; $('box_'+all_fields[t]).set('morph', {duration: 500, transition: 'linear'}); $('box_'+all_fields[t]).morph({width: 144}); } } $('box_'+fieldName).style.backgroundImage = 'url(/images/img_'+fieldName+'_active.jpg)'; $('tab_'+fieldName).src = '/images/tab_active.png'; $('text_'+fieldName).src = '/images/tab_'+fieldName+'_active.png'; $('box_'+fieldName).set('morph', {duration: 500, transition: 'linear'}); $('box_'+fieldName).morph({width: 240}); } Possibly I'm going about it the wrong way? Any suggestions would be greatly appreciated! I only dabble in a little bit of MooTools so I'm not the greatest at it Thanks! mb89 Hi, I have a question here. I have 2 videos and if I click the image which uses #usemap, it will switch to the specific videos I clicked. FF and chrome has no problem but only IE. The scenario is like this: Actual scenario is when the page load, it will display tab 1, video 1 and tab 2 is greyed out. If I clicked on tab 2, tab 1 is greyed out and video 2 is display. Both tabs I use #usemap. But now the problem in IE is that it keeps on displaying tab 1 and video 2 instead of video 1 and when I clicked tab 2, tab 2 is selected but no video is loaded. Below is a simple code which hope it can helps better understanding of what I'm trying to do: Code: <div> <img src="tab.jpg" id="tab1" #usemap="videotab"> <img src="tab.jpg" id="tab2" #usemap="videotab"> </div> <div id="video1" style="display:block"><"1st video source codes here"></div> <div id="video2" style="display:none"><"2nd video source codes here"></div> <map name="videotab"> <area href="" onclick="swapvideo(1); return false;" /> <area href="" onclick="swapvideo(2); return false;" /> </map> function swapvideo(num){ if (num == 1) { document.getElementById("video1").style.display = "block"; document.getElementById("video2").style.display = "none"; document.getElementById("tab1").style.display = "block"; document.getElementById("tab2").style.display = "none"; } else if (num == 2) { document.getElementById("video2").style.display = "block"; document.getElementById("video1").style.display = "none"; document.getElementById("tab2").style.display = "block"; document.getElementById("tab1").style.display = "none"; } } This is the brief code. IE just keep displaying video 2 when page load and video doesn't loads when tab 2 is clicked. Even if I program the 2 divs to be show, it only shows video 2 and video 1 is nowhere to be seen. And I tried taking out the video 2 codes, video 1 then can be seen. Hope you guys out there can understand what I'm trying to say. I need help calculating the average for a Practical Exam 1) the teacher asked us to create a for loop and prompt the user to enter 10 numerical grade. (which I did) 2) She wants us to find the average of the user's 10 entry, and give them their final grades (ex: user enters 80, 90, 70, 90 etc.., the counter will stop prompting for entry after the 10th entry) I need to display, your final grade for the class 85, you've got a B) I need help figuring out the average formula! Please, i need to e-mail the teacher my practical by 10 PM (eastern time). Thank you, victory1 im currently using a prototype add on for one of my sites and id like to convert it to mootools... problem is, i dont know the first thing about prototype! i stumbled upon this before i learned any javascript and ive gotten to know mootools and like using it... heres the code, let me know if anyone can help! Code: /** * @author Bruno Bornsztein <bruno@missingmethod.com> * @copyright 2007 Curbly LLC * @package Glider * @license MIT * @url http://www.missingmethod.com/projects/glider/ * @version 0.0.3 * @dependencies prototype.js 1.5.1+, effects.js */ /* Thanks to Andrew Dupont for refactoring help and code cleanup - http://andrewdupont.net/ */ Glider = Class.create(); Object.extend(Object.extend(Glider.prototype, Abstract.prototype), { initialize: function(wrapper, options){ this.scrolling = false; this.wrapper = $(wrapper); this.scroller = this.wrapper.down('div.scroller'); this.sections = this.wrapper.getElementsBySelector('div.section'); this.options = Object.extend({ duration: 1.0, frequency: 3 }, options || {}); this.sections.each( function(section, index) { section._index = index; }); this.events = { click: this.click.bind(this) }; this.addObservers(); if(this.options.initialSection) this.moveTo(this.options.initialSection, this.scroller, { duration:this.options.duration }); // initialSection should be the id of the section you want to show up on load if(this.options.autoGlide) this.start(); }, addObservers: function() { var controls = this.wrapper.getElementsBySelector('div.controls a'); controls.invoke('observe', 'click', this.events.click); }, click: function(event) { this.stop(); var element = Event.findElement(event, 'a'); if (this.scrolling) this.scrolling.cancel(); this.moveTo(element.href.split("#")[1], this.scroller, { duration:this.options.duration }); Event.stop(event); }, moveTo: function(element, container, options){ this.current = $(element); Position.prepare(); var containerOffset = Position.cumulativeOffset(container), elementOffset = Position.cumulativeOffset($(element)); this.scrolling = new Effect.SmoothScroll(container, {duration:options.duration, x:(elementOffset[0]-containerOffset[0]), y:(elementOffset[1]-containerOffset[1])}); return false; }, next: function(){ if (this.current) { var currentIndex = this.current._index; var nextIndex = (this.sections.length - 1 == currentIndex) ? 0 : currentIndex + 1; } else var nextIndex = 1; this.moveTo(this.sections[nextIndex], this.scroller, { duration: this.options.duration }); }, previous: function(){ if (this.current) { var currentIndex = this.current._index; var prevIndex = (currentIndex == 0) ? this.sections.length - 1 : currentIndex - 1; } else var prevIndex = this.sections.length - 1; this.moveTo(this.sections[prevIndex], this.scroller, { duration: this.options.duration }); }, stop: function() { clearTimeout(this.timer); }, start: function() { this.periodicallyUpdate(); }, periodicallyUpdate: function() { if (this.timer != null) { clearTimeout(this.timer); this.next(); } this.timer = setTimeout(this.periodicallyUpdate.bind(this), this.options.frequency*1000); } }); Effect.SmoothScroll = Class.create(); Object.extend(Object.extend(Effect.SmoothScroll.prototype, Effect.Base.prototype), { initialize: function(element) { this.element = $(element); var options = Object.extend({ x: 0, y: 0, mode: 'absolute' } , arguments[1] || {} ); this.start(options); }, setup: function() { if (this.options.continuous && !this.element._ext ) { this.element.cleanWhitespace(); this.element._ext=true; this.element.appendChild(this.element.firstChild); } this.originalLeft=this.element.scrollLeft; this.originalTop=this.element.scrollTop; if(this.options.mode == 'absolute') { this.options.x -= this.originalLeft; this.options.y -= this.originalTop; } }, update: function(position) { this.element.scrollLeft = this.options.x * position + this.originalLeft; this.element.scrollTop = this.options.y * position + this.originalTop; } }); I am trying to get these Mootool Tooltips to work: http://demos111.mootools.net/Tips Nothing on the internet seems up to date or valid. I can NOT get these to work. I have been consistently trying for two days. I'm not an expert at coding, but I'm good enough to produce something like this: http://www.starforge.us/apply/ Okay, so what I need this for is a module. When you hover over the image, a description will come up. It needs to follow the mouse, as long as it is inside the image. I need the style to look just like what is provided. It gives you the JS code, the HTML code, and a CSS code. They have a webpage that tells you what things do, but I've tried. I've called their core framework, and nothing happens, added the JS code to the framework, nothing, added css framework, nothing. I can NOT get this to work. If anyone knows ANYTHING or has a functioning download of that, ALL FILES INCLUDED. So I can just switch the cow to my stupid image and change the text, it would be most appreciated. I need this for a website my boyfriend is doing. I've looked at buying other tooltips but NONE of them have the functionality that Mootools has. Complete list of the codes would be great. All I need is one image with descriptive text, please. We have standards, so I will accept nothing of less quality than what is above. It doesn't have to be mootools, it just has to look like it and function like it. I can't get ANYTHING to work, protools, etc. etc. People only link code EXAMPLES. I need a file I can sift through that actually WORKS. Something I can play around with, and if it works, I can THEN FIGURE OUT WHY. For some reason, when it comes to tooltips, I'm handed a bunch of crap files that DON'T WORK and at that point, I don't know how to fix them... Thank you VERY much for ANY help. If you have a link to the code that I can BUY it with I will. Willing to pay $5.00 for them if you can produce one that looks EXACTLY like the mootools or whatever. (that's what they're going for on codecanyon.net). Please help. I'm really sick of these stupid tooltips. :P Hello, I have a problem with my code which only appears in ie (more specifically on ie8, I haven't tested it on any other versions yet). I have absolutely no problems with firefox (v4) or Chrome (v10). I am trying to use the standalone version of the RokBox plugin (http://www.rockettheme.com/extensions-joomla/rokbox), which uses mootools-release-1.11.js. The use of rokbox in my application is necessary for me in order to easily display some linked files with a fancy pop-up box and more importantly to use the "gallery" property so that my links can be grouped together and shown in order by just clicking some "next" button... To explain this (I 'll try to be as thorough as possible so that you get what happens): 1)I am using an index.php file which is as you can guess of course the "index". 2)I am calling some functions to compose a query for my database. 3)I am using AJAX to send those queries in another file called values.php. 4)This file takes the data from my database and echoes them. 5)The echoed values are returned and echoed in index.php as options (dropdown list). 6)When the user selects a value on a field some new queries are composed and AJAX is called again but this time it sends data to another file called results.php which echoes back the found matches to a specified div on index.php. (And also calls values.php again to pass new queries). 7) The data returned from the results contain a link to another file called details.php. 8)I am using RokBox to make these links open in a fancy pop-up box with arrows that point to the next or previous link based on the gallery that was generated by RokBox. Now here's some parts of my code: index.php header section (attention:some of this code is commented): [HTML] <script type="text/javascript" src="../rokbox/mootools-release-1.11.js"></script> <!--<script type="text/javascript" src="../rokbox/mootools-core-1.3.1-full-compat.js"></script>--> <!--<script type="text/javascript" src="../rokbox/mootools-1.2.5-core-nc.js"></script>--> <script type="text/javascript" src="../rokbox/rokbox.js"></script> <link href="../rokbox/themes/mynxx/rokbox-style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../rokbox/themes/mynxx/rokbox-config.js"></script> <script type="text/javascript" src="myscript.js"></script> <script type="text/javascript" src="allfields.js"></script> [/HTML]myscript.js (part of it): Code: function AJAX(i,query){ /* Establish AJAX connection */ if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari try{ xmlhttp[i]=new XMLHttpRequest(); }catch(err){ alert("ERROR IN AJAX["+i+"]: "+err)} } else {// code for IE6, IE5 xmlhttp[i]=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp[i].onreadystatechange=function() //line 21 {//alert("check"); if (xmlhttp[i].readyState==4 && xmlhttp[i].status==200) { document.getElementById("opt"+i).innerHTML=xmlhttp[i].responseText; if(i==-1) mybox(); //I'm re-calling RokBox here so that it can recognize the new items } } /* Send data to php file */ // alert("Field: "+obj[i].field+" \n Query: "+query); if(i!=-1){ xmlhttp[i].open("POST","values.php",true); xmlhttp[i].setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp[i].send('query='+query+'&field='+obj[i].field+'&i='+i); }else{ xmlhttp[i].open("POST","../results.php",true); xmlhttp[i].setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp[i].send('query='+query); } } Now the problem: On every first run of this webpage using ie I get the following error generated by the try-catch commands: Code: ERROR IN AJAX[0]: TypeError: Object doesn't support this property or method Then everything freezes... IE itself throws me the following error: Code: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C) Timestamp: Sat, 2 Apr 2011 12:34:07 UTC Message: 'xmlhttp[...]' is null or not an object Line: 21 Char: 4 Code: 0 URI: http://.............../advanced/myscript.js Line 21 is marked on the script code with comments. These errors do not reoccur when the page is reloaded (and as I already said it only happens with ie). So, by this error (and after some debugging) I get that for some reason the AJAX methods are not called as ought to be when I use the tag: [HTML]<script type="text/javascript" src="../rokbox/mootools-release-1.11.js"></script>[/HTML]on my index's head section. So... AJAX cannot work with using mootools? After some research, I found that mootools which uses the $ sign to start it's operations, conflicts with other libraries (such as jQuery) using the same sign ($) for their own reasons. Now I found that the way to fix this is by using jQuery.noconflict() after your jQuery script. There's only one little thing: I DON'T use jQuery, so where is the conflict? I also tried updating mootools to a newer release (as you can see from the comments in head section) but I realized that RokBox can't work with other versions. I am pretty desperate with this, and I would really appreciate any solutions you can offer with your experience or any suggestions you think would help. You can check the issue your self by visiting my link: http://e-tech.ath.cx/ares/project%20...nced/index.php Hi, I am needing some help with the mootools script. I have uploaded a test page at http://74.52.32.68/~tempcom/slider/ Here is what I am attempting to do. When I click on one of the items (say Landscapes), I want some corresponding text to appear in the green box above. Is this possible? Would it be a javascript? Any sample codes or assistance would be greatly appreciated. Thanks in advance! Hi All, I had to switch to Mootools, because the current company I am working for uses MooTools. Till thus far I haven't had any problems with MooTools until about 10min ago. I am using a plug in called noobSlide, You can check it out here http://www.efectorelativo.net/laboratory/noobSlide/ My problem is that for some or other reason it displays 5 images instead of 4 images(the amount I am using), leaving the lastly displayed image blank. Code: Head: <link rel="stylesheet" type="text/css" href="./css/liquidstyle.css" /> <link rel="stylesheet" type="text/css" href="./css/screen.menumatic.css" /> <link rel="stylesheet" type="text/css" href="./css/jd.gallery.css" /> <script src="../root/scripts/core.js" type="text/javascript"></script> <script src="../root/scripts/mootools-1.2.1-core.js" type="text/javascript"></script> <script src="../root/scripts/mootools-1.2-more.js" type="text/javascript"></script> <script src="../root/scripts/menumatic.js" type="text/javascript"></script> <script src="../root/scripts/com_form.js" type="text/javascript"></script> <script src="../root/scripts/com_list.js" type="text/javascript"></script> <script src="../root/scripts/com_panel.js" type="text/javascript"></script> <script src="../root/scripts/com_tab.js" type="text/javascript"></script> <script src="../root/scripts/roar.js" type="text/javascript"></script> <script src="../root/scripts/jd.gallery.js" type="text/javascript"></script> <script src="../root/scripts/jd.gallery.transitions.js" type="text/javascript"></script> <script src="../root/scripts/_class.noobSlide.packed.js" type="text/javascript"></script> Code: page: <script type="text/javascript"> window.addEvent('domready',function(){ var nS2 = new noobSlide({ box: $('box2'), size: 945, items: [0,1,2,3,4], interval: 3000, fxOptions: { duration: 2500, transition: Fx.Transitions.Bounce.easeOut, wait: false }, addButtons: { previous: $('prev1'), next: $('next1') } }); }); </script> Code: HTML: <div class="mask2"> <div id="box2"> <span class="sShow"><img src="images/branding_your_website/img_1.jpg" alt="Photo" /></span> <span class="sShow"><img src="images/branding_your_website/img_2.jpg" alt="Photo" /></span> <span class="sShow"><img src="images/branding_your_website/img_3.jpg" alt="Photo" /></span> <span class="sShow"><img src="images/branding_your_website/img_4.jpg" alt="Photo" /></span> </div> </div> <p class="buttons"> <span id="prev1"><< Previous</span> <span id="next1">Next >></span> </p> Thanks in advance Hello guys, I need some help. I am very noob in Jquery and Mootools .. and they were getting conflicted on one page. I tried every tutorial available online but I couldn't get my jquery slideshow and mootools menu to work together. Not even by the jquery no conflict command. Code: window.addEvent('domready', function(){ //-vertical var mySlide = new Fx.Slide('v.menu-4'); mySlide.hide(); $('toggle-4').addEvent('click', function(e){ e = new Event(e); mySlide.toggle(); e.stop(); }); }); This script is for vertical menus and written for mootools 1.11 Can anybody help me out? Im coding with Mootools and JD Gallery I am running into a annoying Java Script Problem or CSS not sure. Here is the site www.NAFC.TV if you view it in FF it looks fine but in IE 8 you will find a space That separates the Picture From the JAVA thumbnails for the rotator making the images mispositioned and cut off. I cant figure out why that is happening can someone please help Thanks Hello, I have been trying to trouble shoot this for quite a while and am stuck. My site works 100% on Firefox, Safari, and Chrome, but in Internet Explore (6,7,8) the only thing that shows up is the background image. The site utilizes a few scripts: MooTools, a rollover replacement script, an iframe custom scrollbar script, and the Zenphoto CMS, that is utilized on other pages and displayed in the iframes. I think my problem may be mootools related, bur really have no idea. This is the site: http://www.ErikaCervantes.com Here is the offending code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>ErikaCervantes.com</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> #main{width:1100px;height:618px;background: url('img/BG.jpg') no-repeat;margin-left:-550px;left:50%;position:absolute} #words{text-align:right;padding-right:30px;padding-top:30px;} .window{width:963px;height:492px;margin-left:-477px;left:50%;position:absolute;background: url('img/windowBG.jpg');top:49px;} .content{float:left;width:618px;height:330px;margin-left:55px;} .scroll{height:220px;width:36px;float:right;text-align:left;margin-top:60px;} .contenthead{padding-top:52px;padding-left:47px;height:35px;width:300px;margin-bottom:15px;} .right{padding-right: 50px; padding-top: 57px; text-align:right;width:200px;float:right;} .back{padding-top:145px;margin-right:-10px} .nav .left{width:600px;height:490px;float:left;} #production{visibility: hidden;} #erika{visibility:hidden;} img{border:0px;} </style> <script type="text/javascript" src="roll.js"></script> <script type="text/javascript" src="mootools.js"></script> <script type="text/javascript"> function showErika(){ $('words').tween('opacity',0); $('erika').set('tween',{duration : 2000}).fade([0,1]); } function hideErika(){ $('erika').tween('opacity',0); $('words').set('tween',{duration : 2000}).fade([0,1]); } function showProduction(){ $('words').tween('opacity',0); $('production').set('tween',{duration : 2000}).fade([0,1]); } function hideProduction(){ $('production').tween('opacity',0); $('words').set('tween',{duration : 2000}).fade([0,1]); } </script> </head> <body style="padding-top:15px;"> <div id="main"> <div id="words"><img src="img/erika_off.jpg" alt="erika_off" width="" height="" onclick="javascript:showErika();" /><img src="img/productions_off.jpg" alt="productions_off" width="" height="" onclick="javascript:showProduction();" style="padding-top:10px;" /></div><!--words--> <div class="window" id="erika"> <div class="right"> <div id="navErika"> <a href="http://www.imdb.com/name/nm2563825/" target="_blank"><img src="img/imdb_off.jpg" width="" alt="Erika Cervantes on IMDB" height="" /></a> <a href="ECfilmography.pdf" ><img src="img/filmog_off.jpg" alt="Download Erika Cervantes Filmography" width="" height="" /></a> <a href="#" target="_blank"><img src="img/editing_off.jpg" alt="View Erika Cervantes Editing Reel" width="" height="" /></a> <a href="mailto:erikamcervantes@gmail.com" ><img src="img/contact_off.jpg" alt="Contact Erika Cervantes" width="" height="" /></a> </div><!--navErika--> <img src="img/erikamail.jpg" alt="erikamail" width="" height="" /> <div class="back"><img src="img/back_off.jpg" alt="Back" width="" height="" onclick="javascript:hideErika();" /></div><!--back--> </div><!--right--> <div id="left"> <div class="contenthead"><img src="img/erikaHeader.jpg" alt="Erika Cervantes" width="" height="" /></div><!--contenthead--> <div class="content"> <!--Scrollable iframe script- By Dynamic Drive--> <!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com--> <!--This credit MUST stay intact for use--> <iframe class="datamain" src="zen/index.php?album=erika" name="bio" width="618" height="330" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" ></iframe> </div><!--content--> <div class="scroll"> <a href="#" onmouseover="scrollspeed=-1" onmousedown="scrollspeed=-2" onmouseout="scrollspeed=0"><img src="img/scrolltop.jpg" alt="scrolltop" width="" height="" /></a><br/><img src="img/scrollmid.jpg" alt="scrollmid" width="" height="" /><br /><a href="#" onmouseover="scrollspeed=1" onmouseout="scrollspeed=0" onmousedown="scrollspeed=2"><img src="img/scrollbottom.jpg" alt="scrollbottom" width="" height="" /></a> </div><!--scroll--> </div><!--left--> </div><!--window erika--> <div class="window" id="production"> <div class="right"> <div class="nav"> <a href="zen/index.php?album=features" target="prod"><img src="img/features_off.jpg" alt="features" width="" height="" /></a> <a href="zen/index.php?album=shorts" target="prod"><img src="img/shorts_off.jpg" alt="shorts" width="" height="" /></a><br /> <a href="zen/index.php?album=web" target="prod"><img src="img/web_off.jpg" alt="web" width="" height="" /></a> <a href="zen/index.php?album=music" target="prod"><img src="img/music_off.jpg" alt="music videos" width="" height="" style="padding-bottom:25px;" /></a> </div><!--nav--> <div class="back"><a href="zen/news" target="prod"><img src="img/back_off.jpg" alt="Back" width="" height="" onclick="javascript:hideProduction();" /></a></div><!--back--> </div><!--right--> <div class="left"> <div class="contenthead"><img src="img/erikatitle.jpg" alt="Erika Cervantes Productions" width="" height="" /></div><!--contenthead--> <div class="content"> <!--Scrollable iframe script- By Dynamic Drive--> <!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com--> <!--This credit MUST stay intact for use--> <iframe class="datamain" src="zen/news/" name="prod" width="618" height="330" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" ></iframe> </div><!--content--> <div class="scroll"> <a href="#" onmouseover="scrollspeed=-1" onmousedown="scrollspeed=-2" onmouseout="scrollspeed=0"><img src="img/scrolltop.jpg" alt="scrolltop" width="" height="" /></a><br/><img src="img/scrollmid.jpg" alt="scrollmid" width="" height="" /><br /><a href="#" onmouseover="scrollspeed=1" onmouseout="scrollspeed=0" onmousedown="scrollspeed=2"><img src="img/scrollbottom.jpg" alt="scrollbottom" width="" height="" /></a> </div><!--scroll--> </div> <!--left--> </div><!--window production--> </div><!--main--> </body> </html> Thank you very much! Hello all I have been trying in vain for many days to resolve a conflict between javascript libraries. I have read far and wide and still have failed to fix this problem, most likely because my programming skills are just about copy and pasting. My homepage uses jquery horizontal css menubar + a combined mootool and prototype accordian type sliding information box in the middle of the webpage. I find that the highlighter of the css menubar does not work when prototype.js is also loaded on the same page. I have read somewhere that $ should be replaced however I have tried every possible option and none works. I have jquery loading first as it is on my template, with this <script type='text/javascript' src='../Web/Templates/jquery-1.3.2.js'></script> <script type='text/javascript' src='js/example.js'></script> And my mootool and prototype loades further below like this <script type="text/javascript" src="scripts/intro/prototype.lite.js"></script> <script type="text/javascript" src="scripts/intro/moo.fx.js"></script> <script type="text/javascript" src="scripts/intro/moo.fx.pack.js"></script> <script type="text/javascript"> function init(){ var stretchers = document.getElementsByClassName('box'); var toggles = document.getElementsByClassName('tab'); var myAccordion = new fx.Accordion( toggles, stretchers, {opacity: false, height: true, duration: 600} ); //hash functions var found = false; toggles.each(function(h3, i){ var div = Element.find(h3, 'nextSibling'); if (window.location.href.indexOf(h3.title) > 0) { myAccordion.showThisHideOpen(div); found = true; } }); if (!found) myAccordion.showThisHideOpen(stretchers[0]); } </script> Could someone please offer me further assistance and enlighten me what other information you require to assist me further. I have attached the example.js inside example.zip file if someone could kindly edit it for myself. Looking forward to your assistance. Sincerely, Lex HELP PLEASE!! Really need to get this working tonight!! I am applying for a design job and must be able to show my portfolio electronically!! **If there is a reason no one is answering, please tell me** I dont think it is that far off, but clearly something is stopping the rollover effectst for all projects EXCEPT "annual report" which is what i want the others to be like. Please, please, please help me!! Visit link: http://twentyfourdesigns.com/portfolio2.asp to see example of what i have and what isnt working. PLEASE HELP!! (Visit link: http://twentyfourdesigns.com/portfolio.asp to see how the code worked BEFORE separating out into jumps/anchors (only works in ff and safari at the moment...i'll worry about ie later as i only need it to work on a mac at the moment) **page code** Code: < <head> <title>Welcome to Twenty-Four Designs</title> <link rel="favicon" HREF="http://twentyfourdesigns.com/favicon.ico" /> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <script src="js/mootools.js" type="text/javascript"></script> <script src="js/noobslide.js" type="text/javascript"></script> <script src="js/portfolio.js" type="text/javascript"></script> </head> <body> <div id="wrap"> <div id="header"><img src="Images/24designsLogo.png" alt="Twenty-four Designs Logo" width="264" height="92" class="photo" /><a href="mailto:deb@twentyfourdesigns.com"><img src="Images/DebSmithContact.png" width="279" height="92" class="photo2" alt="Deborah Smith's Portfolio" /></a></div> <div id="slide-mask"> <div id="slide-images"> <img src="Images/PortfolioImages/MiddlefieldFront.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread1.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread2.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread3.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread4.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread5.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldBack.png" alt="" /> <img src="Images/PortfolioImages/VerizonDroidWrap.png" alt="" /> <img src="Images/PortfolioImages/VerizonCavsInvite.png" alt="" /> <img src="Images/PortfolioImages/VerizonSMBGuide.png" alt="" /> <img src="Images/PortfolioImages/DCPressKitFront.png" alt="" /> <img src="Images/PortfolioImages/DCPressKitInside1.png" alt="" /> <img src="Images/PortfolioImages/DCPressKitInside2.png" alt="" /> <img src="Images/PortfolioImages/DCPressKitBack.png" alt="" /> <img src="Images/PortfolioImages/PerfcoPC1.png" alt="" /> <img src="Images/PortfolioImages/PerfcoPC2Cover.png" alt="" /> <img src="Images/PortfolioImages/PerfcoPC2inside.png" alt="" /> <img src="Images/PortfolioImages/PerfcoBillInsert.png" alt="" /> <img src="Images/PortfolioImages/CenturyCatalogFront.png" alt="" /> <img src="Images/PortfolioImages/CenturyCatalogSpread1.png" alt="" /> <img src="Images/PortfolioImages/CenturyCatalogSpread2.png" alt="" /> <img src="Images/PortfolioImages/CenturyCatalogSpread3.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept1Cover.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept1Spread1.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept1Spread2.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept2Cover.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept2Spread1.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept2Spread2.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept2Spread3.png" alt="" /></div> </div></div> <div id="slider"> <ul class="navigation"> <li><a href="#AnnualReport">Annual Report :</a></li> <li><a href="#Verizon">Verizon Wireless :</a></li> <li><a href="#PressKit">Press Kit :</a></li> <li><a href="#Perfco">Perfco :</a></li> <li><a href="#Century">Century Windows :</a></li> <li><a href="#UCC">United Church of Christ</a></li> </ul> <div class="scroll"> <div class="panel" id="AnnualReport"><p class="text"><strong>Middlefield Banc. 2008 Annual Report</strong> : Printed Four Color Process on Coated Paper</p> <div id="slide-thumbs"> <img src="Images/PortfolioImages/MiddlefieldFront.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread1.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread2.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread3.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread4.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldSpread5.png" alt="" /> <img src="Images/PortfolioImages/MiddlefieldBack.png" alt="" /></div></div> <div class="panel" id="Verizon"><p class="text"><strong>Verizon Wireless</strong> : Slide One - Motorola Droid Box Sleeve : Slide Two - Cleveland Cavaliers' VIP Invite : Slide Three - Small Business Guide (Internal Website)</p> <div id="slide-thumbs"> <img src="Images/PortfolioImages/VerizonDroidWrap.png" alt="" /> <img src="Images/PortfolioImages/VerizonCavsInvite.png" alt="" /> <img src="Images/PortfolioImages/VerizonSMBGuide.png" alt="" /></div></div> <div class="panel" id="PressKit"><p class="text"><strong>Rock. Ride. Remember. Press Kit</strong> : Printed Four Color Process on Coated Paper : All Over Dull with Spot Varnish : Custom Die Cut </p> <div id="slide-thumbs"> <img src="Images/PortfolioImages/DCPressKitFront.png" alt="" /> <img src="Images/PortfolioImages/DCPressKitInside1.png" alt="" /> <img src="Images/PortfolioImages/DCPressKitInside2.png" alt="" /> <img src="Images/PortfolioImages/DCPressKitBack.png" alt="" /></div></div> <div class="panel" id="Perfco"><p class="text"><strong>Perfco Bill Insert and Postcards</strong> : Printed Digital on Coated Paper : Variable Printed with Target Company's Name</p> <div id="slide-thumbs"> <img src="Images/PortfolioImages/PerfcoPC1.png" alt="" /> <img src="Images/PortfolioImages/PerfcoPC2Cover.png" alt="" /> <img src="Images/PortfolioImages/PerfcoPC2inside.png" alt="" /> <img src="Images/PortfolioImages/PerfcoBillInsert.png" alt="" /></div></div> <div class="panel" id="Century"><p class="text"><strong>Century Windows' Catalog Pages</strong> : Printed Four Color Process on Coated Paper</p> <div id="slide-thumbs"> <img src="Images/PortfolioImages/CenturyCatalogFront.png" alt="" /> <img src="Images/PortfolioImages/CenturyCatalogSpread1.png" alt="" /> <img src="Images/PortfolioImages/CenturyCatalogSpread2.png" alt="" /> <img src="Images/PortfolioImages/CenturyCatalogSpread3.png" alt="" /></div></div> <div class="panel" id="UCC"><p class="text"><strong>United Church of Christ Coffee Table Book Concepts</strong> : Concept 1 - Vellum Wrap on Cover with Spot UV : Concept 2 - Spot UV on Cover</p> <div id="slide-thumbs"> <img src="Images/PortfolioImages/UCCConcept1Cover.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept1Spread1.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept1Spread2.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept2Cover.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept2Spread1.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept2Spread2.png" alt="" /> <img src="Images/PortfolioImages/UCCConcept2Spread3.png" alt="" /></div></div> </div> </div> </body> **css** Code: * { margin-left: auto ; margin-right: auto ;; padding: 0; outline: none; /*outline: 0;*/ } p.text{ font-family: Tahoma, Geneva, sans-serif; font-size: 11px; line-height: 16px; color: #000 } p.text2{ font-family: Tahoma, Geneva, sans-serif; font-size: 12px; line-height: 16px; font-weight: bolder; color: #3c2639; } /* ********************************** */ #slide-mask { position:relative; left:0; margin:0; padding:0; width:920px; height:650px; overflow:hidden; margin-left:auto; margin-right:auto; } #slide-images { position:relative; left:0; width:9000px; height:650px; margin-left:auto; margin-right:auto; } #slide-images img { width:920px; height:650px; } #slide-thumbs { background-color:none; width:880px; height:75px; left:0; margin-left:auto; margin-right:auto; } #slide-thumbs img { width:106px; height:75px; cursor:pointer; } /* ********************************** */ #slider { position:relative; left:0; width: 900px; overflow:hidden; margin-left:auto; margin-right:auto; } .scroll { position:relative; height: 105px; width: 900px; overflow-y: hidden; background: none; margin-left:auto; margin-right:auto; } #scrollContainer div.panel { height: 105px; width: 900px; overflow:hidden; margin-left:auto; margin-right:auto; } ul.navigation { list-style: none; margin: 0; padding: 0; padding-bottom: 9px; } ul.navigation li { display: inline; margin-right: 10px; } ul.navigation a { text-decoration:none; font-family: Verdana, Geneva, sans-serif; font-size: 11px; border: none; color: #3c2639; font-weight: bolder; text-transform:uppercase; } ul.navigation a:hover { text-decoration:none; font-family: Verdana, Geneva, sans-serif; font-size: 11px; border: none; color: #5a447a; font-weight: bolder; text-transform:uppercase; } ul.navigation a.selected { text-decoration:none; font-family: Verdana, Geneva, sans-serif; font-size: 11px; border: none; color: #3c2639; font-weight: bolder; text-transform:uppercase; } ul.navigation a:focus { text-decoration:none; font-family: Verdana, Geneva, sans-serif; font-size: 11px; border: none; color: #3c2639; font-weight: bolder; text-transform:uppercase; } /* ********************************** */ body { width: auto; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; background-image: url(Images/bckgrnd.jpg); background-repeat: repeat-x; background-position: center top; } #wrap { float: none; width: 1000px; height: auto; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; } #header { width: 1000px; height: 100px; margin-left: auto ; margin-right: auto ; padding-top: 7px; } .photo { float: left; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } .photo2 { float: right; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } .photo3 { margin-left: auto ; margin-right: auto ; } a:link { text-decoration:none; font-family: Verdana, Geneva, sans-serif; font-size: 11px; border: none; color: #3c2639; font-weight: bolder; text-transform:uppercase; } a:visited { text-decoration:none; font-family: Verdana, Geneva, sans-serif; font-size: 11px; border: none; color: #3c2639; font-weight: bolder; text-transform:uppercase; } a:active { text-decoration:none; font-family: Verdana, Geneva, sans-serif; font-size: 11px; border: none; color: #3c2639; font-weight: bolder; text-transform:uppercase; } a:hover { text-decoration:none; font-family: Verdana, Geneva, sans-serif; font-size: 11px; border: none; color: #5a447a; font-weight: bolder; text-transform:uppercase;} **portfolio.js ** Code: // JavaScript Document window.addEvent("domready", function () { var effect = {property:'left',duration:700, transition:Fx.Transitions.Linear, wait:false}; var nS = new noobSlide({ box: $('slide-images'), items: [0,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], size:925, handles: $$('#slide-thumbs img'), handle_event: 'mouseenter', fxOptions: effect, onWalk: function(currentItem,currentHandle){ $each($$(this.handles), function(handle,index){ handle.get('tween', {property: 'opacity', duration: 'short'}).start(1); }); currentHandle.get('tween', {property: 'opacity', duration: 'short'}).start(0.5); }, }); }); I also use the mootools.js and noobslide.js... mediasource.saymikeo.com At the bottom of this page, click the web or video big white box. Then turn your attention to the select boxes. When you select either of the first two choices, another box should pop up next to the select box. That box should populate with other choices. 1. My problem is the secondary box does not populate with the correct data. 2. When you select option 3 or 4 the box should disappear. This works in Firefox. This is done through a JSON call in Mootools. If you can figure this out I will think you are totally awesome. First for going through my messy code and second for being able fix it. Your assistance is greatly appreciated. This is the base function that calls view_category() which calls add_select_box(); Code: function build_page(url, id){ $('ajax_box').set('html', ''); dbug.log('Obj URL: ', id, url); // Get the requested view var view = new Request.JSON({ url: url, onSuccess: function(jsonObj){ view_category(jsonObj.selectbar, id); } }).send().chain(function(){ new Fx.Tween(service).start('opacity', '1'); }); } This is the view_category function. Its purpose is to build everything below the select box. It calls the add_select_box. Code: // Viewing the Title, Description and sub descriptions function view_category(oSelect, id){ add_select_box(oSelect, id); oSelect.each(function(oOptions){ if(oOptions.id == id){ var service_type = new Element('div', {id: oOptions.id, 'class': 'sub_choice'}).inject($('ajax_box'), 'bottom'); oOptions.options.each(function(oSub){ var blank_div = new Element('div').inject(service_type, 'bottom'); // Needed for the Expand Link to work var service_title = new Element('h2').set('html', oSub.title).inject(blank_div, 'bottom'); // Title var service_description = new Element('p').set('html', oSub.description).inject(blank_div, 'bottom'); // Description var expand = new Element('div', {'class': 'expanding'}).inject(blank_div, 'bottom'); // Expanding Sub Box if(oSub.sub != undefined){ // Expanding and Colapsing Link var service_elink = new Element('a', {href: 'javascript:void(0)', onclick: 'expand(this); return false'}).set('html', 'more').inject(service_description); oSub.sub.each(function(oSubOptions){ var sub_div = new Element('div').inject(expand, 'bottom'); var sub_title = new Element('h3').set('html', oSubOptions.title).inject(sub_div, 'bottom'); // Sub Title var sub_description = new Element('p').set('html', oSubOptions.description).inject(sub_div, 'bottom'); // Sub description if(oSubOptions.sub_description != undefined){ var sub_elink = new Element('a', {href: 'javascript:void(0)', onclick: 'expand(this); return false'}).set('html', 'more').inject(sub_description); var sub_expanding = new Element('div', {'class': 'expanding'}).inject(sub_div, 'bottom'); // Sub Sub Expanding var sub_sub_description = new Element('p').set('html', oSubOptions.sub_description).inject(sub_expanding, 'bottom'); // Sub Sub Description }; }); }; }); } }); }; This code adds the select box and changes the select box when the select button is changed. Code: function add_select_box(oSelect, id){ var select_box = new Element('div', {id:'select_box'}).inject($('ajax_box')); var formSelectVar = new Element('select'); oSelect.each(function(item){ if(item.id == id){ var continue_div = new Element('div', {id:'continue'}).inject(select_box); new Element('a', {href:'javascript:void(0)'}).inject(continue_div); if(item.id == id){ // Create each option for the first select box item.options.each(function(myArray){ var formOption = new Element ('option').set('html', myArray.title).inject(formSelectVar); }); new Element('option', {selected:'selected'}).set('html', 'Choose').inject(formSelectVar, 'top'); formSelectVar.inject($('select_box'), 'top' ); // This is the First Select Box $('ajax_box').getElement('select').addEvent('change', function(){// Listen for the select box to change var categoryValue = $('ajax_box').getElement('select').value; if($('sub_select')){ var formSelectVar = $('sub_select').set('html', ''); }else { var formSelectVar = new Element('select', {id:'sub_select'}); } // Make a secondary select box for additional options var notdefined; item.options.each(function(myArray){ if(myArray.sub != undefined && myArray.title == categoryValue){ dbug.log('Secondary Select: ', myArray.sub, myArray.title, categoryValue) myArray.sub.each(function(subArray){ var formOption = new Element ('option').set('html', subArray.title).inject(formSelectVar); }); notdefined = false; }else if(myArray.title == categoryValue){ dbug.log('Else Dialoge: ', myArray.sub, myArray.title, categoryValue) notdefined = true; } }); dbug.log('Not Defined: ', notdefined); if(notdefined != true){ new Element('option', {selected: 'selected'}).set('html', 'Choose').inject(formSelectVar, 'top'); formSelectVar.inject($('select_box')); // This is the second select box }else{ formSelectVar.dispose(); } }); }; } }); }; |