zog953 Posted October 29, 2009 Share Posted October 29, 2009 Hi,As mentioned in the title, I would like my iframe to scroll along the x axis automatically so that the content on that page appears like a sliding film strip (if that makes any sense).Can this be done?Thanks! Link to comment Share on other sites More sharing options...
thescientist Posted October 29, 2009 Share Posted October 29, 2009 would setting the width of the page to something really wide, like 2000px or something like that, do anything to help? Link to comment Share on other sites More sharing options...
zog953 Posted October 31, 2009 Author Share Posted October 31, 2009 That is not really what I had in mind, I am more after having an automatic scrolling in the window itself. Link to comment Share on other sites More sharing options...
thescientist Posted November 1, 2009 Share Posted November 1, 2009 you asked for x axis. isn't x axis from left left to right? maybe i just read your question wrong. %'s? Link to comment Share on other sites More sharing options...
ShadowMage Posted November 2, 2009 Share Posted November 2, 2009 I think what he's looking for is an effect similar to a flash element. Where iframe is a specified width and the image "slides" through.Perhaps Flash might be the way to go. Link to comment Share on other sites More sharing options...
thescientist Posted November 2, 2009 Share Posted November 2, 2009 i getcha Link to comment Share on other sites More sharing options...
GermanPrince Posted November 3, 2009 Share Posted November 3, 2009 How about a GIF animation? Link to comment Share on other sites More sharing options...
zog953 Posted November 16, 2009 Author Share Posted November 16, 2009 Thanks for the replies folks, I think you have kind got what I am after.There is a 'kind-of' example here in the news section. The reason I say kind of is that you'll notice they've not used iframes, they've used quite a clever technique though, but in truth I can't get my head around it...This page shows another example-ish http://www.csbsupport.com/samplecode/id284.htmCheers. Link to comment Share on other sites More sharing options...
Ingolme Posted November 16, 2009 Share Posted November 16, 2009 Making a normal <div> scroll is easier than making an iframe scroll.To make an iframe scroll you probably have to access the <body> element that¡s inside the frame and modify its scrollLeft or scrollTop properties. It will only work if the iframe is in the same domain as the main document.With a normal <div> element you just need to modify the scrollLeft ad scrollTop properties of the <div> element. Link to comment Share on other sites More sharing options...
mattmill30 Posted November 16, 2009 Share Posted November 16, 2009 Hi zog,I've just checked on w3schools, and marquee isn't on there :)I dunno where its gone, perhaps it was never a w3c standard, but that seems ideal for what you want.Can someone comment as to the situation with marquee? is it a standard? or has it been depreciated? <!-- HTML codes by Quackit.com --><marquee behavior="scroll" direction="left"><img src="/pix/smile.gif" width="100" height="100" alt="smile" /><p>Sample text under a marquee image.</p></marquee> Thats an example of both an image and text in a marquee.source: http://www.quackit.com/html/codes/html_marquee_code.cfmThe attributes and values for the tag are:behaviour="slide, scroll, alternate"direction="left, right, up, down"scrollspeed="#"Appologies if this isn't a w3c standard.Thanks,Matthew Millar Link to comment Share on other sites More sharing options...
Ingolme Posted November 16, 2009 Share Posted November 16, 2009 <marquee> was never an HTML standard. And if you go to the W3C validator, it will give an error if you have a <marquee> tag on your page. Link to comment Share on other sites More sharing options...
mattmill30 Posted November 16, 2009 Share Posted November 16, 2009 Thanks Ingolme.Zog, if the link i provided shows the kind of thing you're looking for.Try one of these:Javascript way:source: http://javascript.about.com/library/bltick2.htm var tWidth='300px'; // width (in pixels)var tHeight='25px'; // height (in pixels)var tcolour='#ffffcc'; // background colour:var moStop=true; // pause on mouseover (true or false)var fontfamily = 'arial,sans-serif'; // font for contentvar tSpeed=3; // scroll speed (1 = slow, 5 = fast)// enter your ticker content here (use \/ and \' in place of / and ' respectively)var content='Are you looking for loads of useful information <a href="http:\/\/javascript.about.com\/">About Javascript<\/a>? Well now you\'ve found it.';// Simple Marquee / Ticker Script// copyright 3rd January 2006, Stephen Chapman// permission to use this Javascript on your web page is granted// provided that all of the below code in this script (including this// comment) is used without any alterationvar cps=tSpeed; var aw, mq; var fsz = parseInt(tHeight) - 4; function startticker(){if (document.getElementById) {var tick = '<div style="position:relative;width:'+tWidth+';height:'+tHeight+';overflow:hidden;background-color:'+tcolour+'"'; if (moStop) tick += ' onmouseover="cps=0" onmouseout="cps=tSpeed"'; tick +='><div id="mq" style="position:absolute;left:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;"><\/div><\/div>'; document.getElementById('ticker').innerHTML = tick; mq = document.getElementById("mq"); mq.style.left=(parseInt(tWidth)+10)+"px"; mq.innerHTML='<span id="tx">'+content+'<\/span>'; aw = document.getElementById("tx").offsetWidth; lefttime=setInterval("scrollticker()",50);}} function scrollticker(){mq.style.left = (parseInt(mq.style.left)>(-10 - aw)) ?parseInt(mq.style.left)-cps+"px" : parseInt(tWidth)+10+"px";} window.onload=startticker; This version appears to use a div element as apposed to marquee, so it should be standards compliant. :)CSS 3 way:O yes! Theres a way of using marquee, in the upcoming release of CSS 3:source: http://www.w3.org/TR/css3-marquee/By the looks of it if you add {overflow: auto; overflow-style: marquee-line; white-space: nowrap} into an li (i'd imagine div will work just as well) css whatever can't be displayed will automatically overflow, however, it will then scroll from one extreme to the other.Hope this helps,Matthew Millar Link to comment Share on other sites More sharing options...
zog953 Posted November 18, 2009 Author Share Posted November 18, 2009 Some great stuff there people, I will play around and let you know how I get on. I probably should have put this on earlier, but this is the site that I want to apply it to ninefivethree.co.uk. Link to comment Share on other sites More sharing options...
zog953 Posted November 19, 2009 Author Share Posted November 19, 2009 I think looking at the javascript code for the marquee, I am not sure that will work with image files. Am I right in understanding that is for text?I think I am going to look into the <div> tag option as suggested below (many thanks), despite having no experience of using them. They seem to be the great liberator of the not so flexible html world, probably why I have not used them... my web design is very antiquated. Making a normal <div> scroll is easier than making an iframe scroll.To make an iframe scroll you probably have to access the <body> element that¡s inside the frame and modify its scrollLeft or scrollTop properties. It will only work if the iframe is in the same domain as the main document.With a normal <div> element you just need to modify the scrollLeft ad scrollTop properties of the <div> element.If anyone has any useful tutorials (I have read w3) that mention bit on how to position and style to a more advanced level that would be great. I am currently looking at the Lissa Explains tutorial which covers the basics nicely.Thanks for your help / advice. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.