Jump to content

Err

Members
  • Posts

    1,009
  • Joined

  • Last visited

Everything posted by Err

  1. Awesome. That worked VERY good. Thank you so much. (err... what do you mean you tested it on my web page? O_o?)I also wanted to ask if you know how to put 2 of those scripts together. Adding them together like the below example renders the javascript useless. It so far only works if they're in there own separate <script> tags. <script type="text/javascript"><!--elements = document.getElementsByTagName("p");for(i=0;i<=elements.length;i++) { if (elements[i].className == 'a') { elements[i].style.display = 'block'; }}elements = document.getElementsByTagName("div");for(i=0;i<=elements.length;i++) { if (elements[i].className == 'b') { elements[i].style.display = 'none'; }}// --></script> Please take a look at my web page again to see what I'm talking about. You can toggle your js on or off then refresh the page to see the result.[removed]
  2. Because I'm very short in time, I'll get right to the problem:I can't get this java script: <script type="text/javascript"><!--elements = document.getElementsByTagName("p"); if (elements.className == 'test') { document.style.display = 'block';}// --></script> to "block" this content: <p class="test">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> with this CSS: <style type="text/css">.test { display: none;}</style> The css display is set to none for the class ".test", but I'm trying to call the javascript to block that class thus the content is only seen when javascript is enabled. I do not want to use id's I know it works, I'm just trying to call a bunch of classes with that javascript. I edit that javascript myself, but it doesn't work.Here is a test page of what I'm talking about:[removed]You have to look at the source to see that some content is actually not displayed because of the style I have on it, but it should be blocked anyways becuase of the javascript I have on there... or so I thought, what am I doing wrong? and is there a work around for what I'm trying to do? Thank you very much for any help on this.
  3. JavaScript for dummiesPHP for dummies. What?
  4. I'm on broadband also, plus I can adblock any images/advertisements I want to speed up my loading time. (Yes, including the ad on the top of this forum )IE = Internet Explorer orMSIE = Mircosoft Internet Explorer
  5. Your content (images, characters) will force your height to expand even if it's set to a fixed height. I do believe that's different if you have your div to display: block; or floating (I'm not totally sure) which in that case your div will stay the same height and your content will "magically" go over the div, giving it a terrible look. overflow just adds scrollable content in a fixed sized div. More about it here:http://www.w3schools.com/css/pr_pos_overflow.asp
  6. Taken from your other topic: I added the bold and italic you wanted, but please take some time to take a look at these links for future reference:http://www.w3schools.com/css/pr_font_font-style.asp (italize)http://www.w3schools.com/css/pr_font_weight.asp (bold)http://www.w3schools.com/css/css_pseudo_classes.asp (hyper-links)To modify in-line hyper links would be something like:<a href="#" style="color:red; text-decoration:none;">Your Text</a>But you can only do so much with an in-line style link.
  7. No problem. I still appreciate your help on the matter. (That is until I code javascript fluently! J/K)
  8. Awsome! It works great. Thanks! :)Thanks for all the help folks.
  9. Thanks for correcting the script mistake choco, however it's still not working. I'm using Firefox and even with your updated script it's still not fully functional. You can look for yourself here:[removed] (Updated sizes)I noticed that if I change around the ">" to "<" on the if (scrnH>1200) {scrnH=800;scrnW=800} part of the code, the pop-up size changes to that of the highest resolution size and vise-versa. That however DOES NOT fix the problem. :)I have a script on the actual pop-up now to tell me and you how big the pop-up window is (it's not exact, but it helps) and what resolution you are currently using for testing purposes, but this script only works correctly in Firefox (please note that). Thanks again for all of y'alls input.
  10. Thanks scott. I see the scrnH>1200 "if" statements and that way will work also, however the problem that I'm having with that script is that only the else {scrnH=350;scrnW=200} part of the script is working, it's completely ignoring the other parts of the script regardless of the screen resolution I have on at the time. Perhaps I messed something up. Can you tell me what went wrong?Here's the code I have now: function popitup(url){ newwindow=window.open(url,'name','height='+scrnH+', width='+scrnW+', scrollbars=yes, status=yes, location=no, resize=yes, toolbar=no, directories=no, menubar=no, status=no left=5, top=5'); if (window.focus) {newwindow.focus()} return false;}scrnH=screen.height;scrnW=screen.width;if (scrnH>1200) { scrnH=800;scrnW=800}else if ((scrnH>1000) && (scrnH<1200)) { scrnH=800;scrnW=450}else { scrnH=350;scrnW=550} I changed the scrnH and the scrnW a bit because I was testing out the script. Also please note that I have this script in an external .js file.Many thanks for the help.
  11. You need a doctype on your page, so you'll have something to validate against (that is if you want to validate your page). Yeah, the template looks a little simple and what justsomeguy said.edit: I'm a little slow
  12. Err

    Welcome

    Might as well join the bandwagon.
  13. @Chocolate570:Well, that script actually makes the pop-up window the exact size of the users resolution. I wanted one that is a fixed height and width for specific resolutions upon them executing the pop-up, but only for more resolutions. The above code I have has a pop-up size (width and height) that is perfect for my resolution, but not so great for others. @jesh:That's not really what I wanted. But thanks.I can better illustrate what I want to do by this image:[removed]Hopefully that helps.
  14. Howdy. I'm looking for way I can add a user executed pop-up to adjust on whatever the screen resolution of the user is. So lets say, me, I have a screen resolution of 1280 x 800, I want a pop-up to change window sizes based on my screen resolution for that specific resolution only. Now I have the pop-up script, I just don't know how I can add the screen.width and screen.height on to the below pop-up script to do that. My best guess would be with the "if" and "else" statements... I just need help on that. I want to do this because on some resolutions, the pop-up window size I have now is a bigger size on a lower resolution, then that of a higher resolution. I just want to eliminate that problem.pop-up script: <script type="text/javascript">function popitup(url){ newwindow=window.open(url,'name','height=500, width=650, scrollbars=yes, status=yes, location=no, resize=yes, toolbar=no, directories=no, menubar=no, status=no left=5, top=5'); if (window.focus) {newwindow.focus()} return false;}</script> It would work better if I had all the pop-up attributes (e.g. "scrollbars=yes, toolbar=no, etc") in each specific resolution containers. If someone could just get me started, I can add the rest of the resolution sizes myself. Thanks.
  15. I checked it with Opera, Mozilla Firefox, and IE. Everything seems okay. lol, what are you on? dail-up? It took about 2 seconds to load (on high-speed cable) for me.
  16. I see. Okay. I thought "cgi" and "cgi-bin" were 2 different things, you know just like "java" and "javascript". But yeah, that link helps.
  17. I've commonly seen "cgi-bin" in url's, and today I was looking around and I finally got curious enough to look it up when I saw it in of my folders in my site... google searching it turned up few worthless results, so I thought I'll ask here. What the heck is it?
  18. Err

    innerHTML issues

    Words can not express how greatful I am! Thank you so much!
  19. http://www.dynamicdrive.com/dynamicindex15/index.htmlThere you go, that might be of some intrest to you.
  20. Fixed width is when you are using px (pixels) or other percise sizes for your document. % (Percentages) are usually not fixed because they can grow with your browser (The more bigger you make your browser window the more bigger/wider your content will get automatically). Learn more here: http://www.w3schools.com/css/pr_dim_width.aspYes, he also wanted you to use the HTML.
  21. Err

    CSS tables

    table { border: 1px solid blue;}
  22. Hi folks.Long story short, I'm trying to edit a script with very little javascript knowledge, and I have no clue what I'm doing wrong (or just doing for that matter) perhaps you good JS folks can help me. :)Script: <script type="text/javascript"> var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [ { string: navigator.vendor, subString: "Apple", identity: "Safari" }, { prop: window.opera, identity: "Opera" }, { string: navigator.vendor, subString: "iCab", identity: "iCab" }, { string: navigator.vendor, subString: "KDE", identity: "Konqueror" }, { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, { // for newer Netscapes (6+) string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" }, { string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" }, { // for older Netscapes (4-) string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" } ], dataOS : [ { string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ]};BrowserDetect.init();</script><script type="text/javascript"> document.write('<span style="color:blue;">' + BrowserDetect.browser + ' ' + BrowserDetect.version + ' / ' + BrowserDetect.OS + '</span>');</script> The above code has 2 scripts, one to detect the browser/operting system (The long script) and another (short script near the bottom) to display the what the long script detected. My problem lies with the 2nd small script; I want to get rid of it and instead have an html tag in it's place like <span id="browser_os"></span>, I just want to simply elimiate the second script and use regular html tags in it's place; so then my next step was to edit the first script so I can add something that I can achieve that with. I came up with innerHTML for a solution, but I have no idea how I can implement it into this script. I have tried to do this by myself, but this is out of my league. Can one of you folks at least guide me into the right direction? If I had not made myself clear, please tell me so I can explain it in a more understanding way.
  23. That is most likely other scripts interfering with it, since Praetorian tested it out on a regular web pages. I couldn't see at first, so I had to disable my adblock to see the frames, then I tested with IE. Have you tried going ADless/frameless? Check out this free ADless webspace hoster. That is what I use (see link in signature).
  24. As far as I know, no, I don't think there's a limit to how many external CSS documents you can add on to a web page, I mean there shouldn't be. You know if you have many styles you want to add to web page, you can just add all the styles you have together on 1 CSS document instead of having 2 or more separate CSS documents. Same would go for JavaScript files, as far as putting all your scripts on 1 JS file... that would require some JS knowledge. Heck I've made pages that have 9 scripts on 1 page.
  25. Err

    divs

    css: .a, .b { float: left; height: 20px; background-color: blue;}.a {width: 80%;}.b {width: 20%;} html: <div class="a">Text Here</div><div class="b">Text Here</div> That code works. I put a background on the divs just to show you there is not gap. Try it out.
×
×
  • Create New...