Jump to content

Kovo

Members
  • Posts

    237
  • Joined

  • Last visited

Posts posted by Kovo

  1. How could I,say, reset the sequential script after it has loaded already.For example, say I load the page and the script executes. How can I reset the script so that it re-executes and re-shows all the content without refreshing the page(using onclick etc...)?Thanks

    <script type="text/javascript">/************************************************ Sequential Content Revealer- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)* Visit DynamicDrive.com for hundreds of original DHTML scripts* This notice must stay intact for legal use***********************************************/var contentpause=1000 //customize time each content should pause for before the next one is revealed (1000=1 second)var once_session=0 //Should "reveal" animation only be applied once per browser session? (0=no, 1=yes):var curobjindex=0var orderoffset=100function collectElementbyClass(){var classname="revealcontent"glidearray=new Array()var inc=0var alltags=document.all? document.all : document.getElementsByTagName("*")for (i=0; i<alltags.length; i++){if (alltags[i].className==classname){glidearray[inc++]=alltags[i]glidearray[inc-1].displayorder=(glidearray[inc-1].getAttribute("displayorder"))? parseInt(glidearray[inc-1].getAttribute("displayorder")) : inc+orderoffset}}if (glidearray.length>0){glidearray.sort(compareorder)seqreveal()}}function seqreveal(){if (curobjindex<glidearray.length){glidearray[curobjindex].style.visibility="visible"var actualpause=(glidearray[curobjindex].getAttribute("pausesec"))? parseFloat(glidearray[curobjindex].getAttribute("pausesec"))*1000 : parseFloat(contentpause)glidetimer=setTimeout("seqreveal()",actualpause)curobjindex++}}function compareorder(a, b){return a.displayorder-b.displayorder}function get_cookie(Name) {var search = Name + "="var returnvalue = ""if (document.cookie.length > 0) {offset = document.cookie.indexOf(search)if (offset != -1) {offset += search.lengthend = document.cookie.indexOf(";", offset)if (end == -1)end = document.cookie.length;returnvalue=unescape(document.cookie.substring(offset, end))}}return returnvalue;}if (once_session && get_cookie("textdisplayed")=="" || !once_session){if (window.addEventListener)window.addEventListener("load", collectElementbyClass, false)else if (window.attachEvent)window.attachEvent("onload", collectElementbyClass)else if (document.getElementById)window.onload=collectElementbyClassif (once_session)document.cookie="textdisplayed=yes"}elsedocument.write('<style>\n.revealcontent{visibility:visible;}\n</style>')</script>

    http://dynamicdrive.com/dynamicindex17/seqreveal.htm

  2. Probably use a negative number rather than a positive number for the level1 part. Or, push forward level2 beyond level1 with a fairly large timeout.
    But where would I put them or how would it look, im kinda new :)
  3. No, because you can't have two onloads on the same page. Unless you set a timeout in a certain manner.
    setimeout(level2)setimeout(level1)

    where the second event would appear before the first rather than in a row.

    How would I implement that in this case?
  4. a little question... why wont it work?This is the snow script:

    // Snowmaker, v. 1.2, 12/11/2006, checked in IE6,7; FF1.06,2.0; Opera 7.54,9.01// Modified (c) 2005, Igor Svetlov, Nickname: 12345c// Copyright (c) 2003 Peter Gehrig. All rights reserved.// Location: http://javascript.aho.ru/example/xmp002/falling-snow.htm// Permission given to use the script provided that this notice remains as is.d=document;g=function(X){return document.getElementById(X);}var unitsNum=15	// Set the number of snowflakes (more than 30 - 40 not recommended)var snowColor=["#c4bbcc","#ccddFF","#ccd6DD"]	// Set the colors for the snow. Add as many colors as you likevar unitFont=["Arial Black","Arial Narrow","Times","Comic Sans MS"]	// Set the fonts, that create the snowflakes. Add as many fonts as you likevar unitText=["<img src=leaf.png>","<img src=leaf2.png>","<img src=leaf21.png>","<img src=leaf22.png>","<img src=leaf23.png>","<img src=leaf24.png>","<img src=leaf25.png>","<img src=leaf26.png>","<img src=leaf27.png>","<img src=leaf28.png>"];	// Set the letter that creates your snowflake (recommended:*)var sinkSpeed=0.3	// Set the speed of sinking (recommended values range from 0.3 to 2)var snowSizeMax=90	// Set the maximal-size of your snowflaxesvar snowSizeMin=22	// Set the minimal-size of your snowflaxesvar snowingLeft=0.0	//left boundary of snow presencevar snowingWidth=0.3	//width of snow presence in windowvar opac=1.0		//snowflakes opacity (0.0-1.0), at 1 it works faster in 2 timesvar stepTime=70	//step of time-lapse animation(ms).At less 100 strongly loads processorvar snowOnScreen=1 // 1/0-regime of scrolling of page (snow on screen/snow on paper)var marginBottom,marginRight,scrlTop=0;var snow=[], x_mv=[], crds=[], lftRght=[];var isOpera=self.opera  var ie5=d.all&&d.getElementById&&!isOperavar ns6=d.getElementById&&!d.allvar opera9=isOpera&&(document.body.style.opacity=='')var browserOk=ie5||ns6||isOperavar ww=0,timer=0;d.write('<div id=snowZone style=position:absolute></div>');var unitsNumOld=0;function createSnow(){for(i=0;i<Math.max(unitsNum,unitsNumOld);i++){if(i<unitsNum){	var o=d.createElement('SPAN');	if(g('s'+i)){snowZone.replaceChild(o,g('s'+i));}	else{snowZone.appendChild(o);}		o.setAttribute('id','s'+i);	o.style.position='absolute';	o.style.top=0-snowSizeMax;	if(ns6)o.style.MozOpacity=opac;	if(opera9)o.style.opacity=opac;	if(ie5){o.style.filter='alpha';o.filters[0].opacity=opac*100;}	snowZone.childNodes[i].innerHTML=unitText[Math.floor(unitText.length*Math.random())];}else{snowZone.removeChild(g('s'+i));}}unitsNumOld=unitsNum;}function randommaker(range){return Math.floor(range*Math.random())}function botRight(){marginBottom=(ns6?innerHeight:d.body.clientHeight)-1.5*snowSizeMax;	marginRight=ns6?innerWidth:d.body.clientWidth;}function checkPgDn(){if(snowOnScreen)g('snowZone').style.top=ns6?pageYOffset:document.body.scrollTop;  scrlTop=ns6?pageYOffset:document.body.scrollTop;}function snowRestart(s){ if(s)eval(s);	createSnow();	snowSizeRange=snowSizeMax-snowSizeMin;	clearInterval(ww);clearTimeout(timer);	checkPgDn();if(ns6)ww=setInterval(checkPgDn,999);	botRight();	for (i=0;i<unitsNum;i++) {	crds[i] = 0;					  				lftRght[i] = Math.random()*20;		 				x_mv[i] = 0.03 + Math.random()/10;		snow[i]=g("s"+i)		snow[i].style.fontFamily=unitFont[randommaker(unitFont.length)]		snow[i].style.fontSize=snow[i].size=randommaker(snowSizeRange)+snowSizeMin;		snow[i].style.color=snowColor[randommaker(snowColor.length)]		snow[i].sink=sinkSpeed*snow[i].size/5		newPosSnow(randommaker(marginBottom-3*snow[i].size),i);	}if(unitsNum)moveSnow();else{clearTimeout(timer);clearInterval(ww);} }function newPosSnow(y,i){var o;	snow[i].posY=y+(snowOnScreen?0:(ns6?pageYOffset:d.body.scrollTop));	snow[i].posX=randommaker(marginRight*snowingWidth-2*snow[i].size)+marginRight*snowingLeft;	snow[i].size=randommaker(snowSizeRange)+snowSizeMin;	if(snow[i].hasChildNodes()&&(o=snow[i].childNodes[0]).tagName=='IMG')o.width=o.height=randommaker(snowSizeRange/1.6)+snowSizeMin;	if(ie5)snow[i].filters[0].opacity=opac*100;if(ns6||opera9)snow[i].style.opacity=opac;	setTimeout("snow["+i+"].style.visibility='visible';",250);}function moveSnow() {	for (i=0;i<unitsNum;i++) {		snow[i].style.top=snow[i].posY+=snow[i].sink+lftRght[i]*Math.sin(crds[i])/3;		crds[i] += x_mv[i];		snow[i].style.left=snow[i].posX+lftRght[i]*Math.sin(crds[i]);		var a=marginBottom+(snowOnScreen?0:scrlTop)-snow[i].posY;		if(a<=9.5*snow[i].size){if(ie5)snow[i].filters[0].opacity=opac*a/(9.5*snow[i].size)*100;		  else if(ns6||opera9)snow[i].style.opacity=opac*a/(9.5*snow[i].size);}		if(a<=0 || parseInt(snow[i].style.left)>(marginRight-3*lftRght[i])){snow[i].style.visibility='hidden';newPosSnow(-1.5*snow[i].size,i);}	}	timer=setTimeout(moveSnow,stepTime)}/*for (i=0;i<unitsNum;i++) {	d.write("<span id='s"+i+"' style='position:absolute;z-index:111;"+(opac<1?"-moz-opacity:"+opac+";filter:alpha(opacity="+(opac*100)+")":"")+";top:-"+snowSizeMax+"'>"		+unitText[Math.floor(unitText.length*Math.random())]+"</span>")}*/onload=function(){if(browserOk)setTimeout(snowRestart,99);}onscroll=checkPgDn;if(self.addEventListener)addEventListener('DOMMouseScroll',function(){setTimeout(onscroll,1)},!1);onresize=botRight;genBr5x=function(N){var s='';while(N>0){s+=N+'<br><br><br><br><br>';N-=5;}return s;}

    The issue is with the onload event.The two example links below demonstrate how the two onload callers I have on my page interfear with each other.Both pages are identical except for:page 1 http://www.kovo.ca/audrey/home1.html^^ This page has the added lines " <body onload="Effect.Appear('firstfade',{delay:0.5, duration:6.0});Effect.Appear('secondfade',{delay:1.5, duration:9.0});Effect.Appear('main',{delay:6.0, duration:5.0});"> "page 2 http://www.kovo.ca/audrey/home2.html^^ This page omits the onload calls in the body tagAny ideas for solutions?Thanks

  5. You can go thru them like this:
    ...echo "<ul>\n";foreach ($xml->INFOBLOG->SITE as $site) {	 // Work with the SITE in $site:	 echo '<li><a href="'.$site->LINK.'" title="'.$site->DESC.'">'.$site->NAME.' - '.$site->DESC."</a></li>\n";}echo "</ul>\n";

    Note: I ignored the attribute url to LINK (I used the content of LINK as the url), as I couldn't figure out the reason for the url-attribute...To get the attribute use the following:

    $site->LINK['url']

    cool thanks man
  6. There would also be a problem with this:
    $xml->load($sites.xml);

    I don't know what's in $sites, but I guess it's the beginning of the filename, change it to one of the below:

    $xml->load($sites . '.xml');or$xml->load('sites.xml');

    (The value of the var. $sites with the .xml extension added, or a file called sites.xml)But you don't need DOM to open a file to then use with SimpleXML (Constructor info), just open it with SimpleXML from the beginning:

    <?php$xml = new SimpleXMLElement('sites.xml', NULL, true);print($xml->INFOBLOG->SITE->NAME);unset( $xml );?>

    Good Luck and Don't Panic!

    Thanks that lst code worked, but now, how do i loop through all the site child nodes in INFOBLOG only and not the restFor example, I want all SITE in INFOBLOG to display but not SITE in <WEBD><?xml version="1.0" standalone="yes"?><SITES> <INFOBLOG> <SITE> <NAME>Kovo's Webspace</NAME> <LINK url="http://www.kovo.ca">http://www.kovo.ca</LINK>'>http://www.kovo.ca">http://www.kovo.ca</LINK> <DESC>An online blog.</DESC> </SITE> <SITE> <NAME>Kovo's Webspace 2</NAME> <LINK url="http://www.kovo.ca 2">http://www.kovo.ca2</LINK> <DESC>An online blog.2</DESC> </SITE> </INFOBLOG> <WEBD> <SITE> <NAME>Kovo's Webspace</NAME> <LINK url="http://www.kovo.ca">http://www.kovo.ca</LINK>'>http://www.kovo.ca">http://www.kovo.ca</LINK> <DESC>An online blog.</DESC> </SITE> <SITE> <NAME>Kovo's Webspace 2</NAME> <LINK url="http://www.kovo.ca 2">http://www.kovo.ca2</LINK> <DESC>An online blog.2</DESC> </SITE> </WEBD> </SITES>
  7. If you are using PHP 5, you could do something like:
    $xml = new DomDocument;$xml->load($xml_file);$xml_obj = simplexml_import_dom($xml);print($xml_obj->INFOBLOG->SITE->NAME);unset($xml, $xml_obj);

    This will print "Kovo's Webspace" to the page. Using the SimpleXML object it makes it easy to traverse the nodes of the xml doc.If you want to loop through the <SITE> nodes, try something like:

    foreach ($xml_obj->INFOBLOG->children() as $child){	if($child->getName() == "SITE")		print($child->NAME);}

    Warning: DOMDocument::load() [function.DOMDocument-load]: I/O warning : failed to load external entity "/mnt/w0108/d41/s44/b02877b8/www/thekovonetwork.net/xml" in /mnt/w0108/d41/s44/b02877b8/www/thekovonetwork.net/infoblog.php on line 4Warning: simplexml_import_dom() [function.simplexml-import-dom]: Invalid Nodetype to import in /mnt/w0108/d41/s44/b02877b8/www/thekovonetwork.net/infoblog.php on line 5
    <?php$xml = new DomDocument;$xml->load($sites.xml);$xml_obj = simplexml_import_dom($xml);print($xml_obj->INFOBLOG->SITE->NAME);unset($xml, $xml_obj);?>

  8. What version of PHP are you using?Also, I do not see a <INFORMATION> node in your xml, so I am not sure which nodes you want to pull out. Did you mean all <SITE> nodes in the <SITES> node?
    Sorry, I meant <INFOBLOG>Using PHP4 or 5 dsnt matter
  9. What would a PHP script look for displaying all <SITE> within the <INFORMATION> category?<?xml version="1.0" encoding="ISO-8859-1"?><?xml-stylesheet type="text/css" href="css2.css"?><SITES><INFOBLOG><SITE><NAME>Kovo's Webspace</NAME><LINK url="http://www.kovo.ca">http://www.kovo.ca</LINK><DESC>An online blog.</DESC></SITE></INFOBLOG><WEBDESIGN><SITE><NAME>Kevmedia</NAME><LINK url="http://www.kevmedia.ca">http://www.kovo.ca</LINK><DESC>A Montreal based, Web Design company.</DESC></SITE></WEBDESIGN></SITES>Im a complete noob to this, and was just wondering if it was simple. Thanks

  10. What would a PHP script look for displaying all <SITE> within the <INFOBLOG> category?<?xml version="1.0" encoding="ISO-8859-1"?><?xml-stylesheet type="text/css" href="css2.css"?><SITES> <INFOBLOG> <SITE> <NAME>Kovo's Webspace</NAME> <LINK url="http://www.kovo.ca">http://www.kovo.ca</LINK> <DESC>An online blog.</DESC> </SITE> </INFOBLOG> <WEBDESIGN> <SITE> <NAME>Kevmedia</NAME> <LINK url="http://www.kevmedia.ca">http://www.kovo.ca</LINK> <DESC>A Montreal based, Web Design company.</DESC> </SITE> </WEBDESIGN> </SITES> Im a complete noob to this, and was just wondering if it was simple. Thanks

  11. Is there a way to set a delay before the following script loads? I know there is, just not sure how to implement.function ajaxResponse() {var updtDiv = document.getElementById("updateDiv");updtDiv .innerHTML = xmlHttpObj.responseText;}

  12. http://stm.suxs.infoSee, in IE the #main div extends way too far down the page, even with no content present. In FF, it wraps nicely arround the end of the content.I cant figure out to do the following. I want the #main background to always extend to the bottom edge of the screen, no matter which content is present.So the last image you see bottom.jpg should always be at the bottom of the page.Ideas?Thanks!
    Its ok, I figured it out!!
  13. http://stm.suxs.infoSee, in IE the #main div extends way too far down the page, even with no content present. In FF, it wraps nicely arround the end of the content.I cant figure out to do the following. I want the #main background to always extend to the bottom edge of the screen, no matter which content is present.So the last image you see bottom.jpg should always be at the bottom of the page.Ideas?Thanks!
  14. Try adding z-index to the pieces you want to control. the lower the number, the lower on the stack. For example, z-index=100 is higher than z-index=50, so you would see the z-index=100 if they were in the same place.
    I wish it were that easy,b ut nuuhh lol
  15. i still have ie6 here...hate ie7 and microsoft with a passion..so i use firefox :)There is a white bg because the bg image is white. Right click in the text and view background image.Have you a screenshot of the grey bits in ie7 and opera??:)
    ah dsnt matter, i hate IE and Opera equally lol, clearly this might be just a "my pc" issue.ahaha
  16. I don't get it? How do you want to edit the page?If you are trying to enter code in a form on one page and have another display the code... Couldn't you use $_POST to save the code from the page you enter it on (as a string) and then get another page to display the string as code after taking it from the array?I'm a bit confused though...not sure I understand what you are doing...
    Basically, I want a simple, bare-bones CMS.I want to be able to say go to admin.php, select .html pages with content in them (coding) and be able to display the coding in a text box. Then I would like to be able to edit this code and hit a submit button so it saves the changes I made to that file. Get it? I hope Im being clearer now. Thanks
  17. Is there a way/script that can allow me to edit the content of a page (very simple, just a text box that shows the code) and save/submit it without using a database?In PHP of course.

×
×
  • Create New...