Everything posted by hire202
-
Divs
A word of caution, do not rely on the design view, well don't rely on dreamweaver for anything, like the above have suggested, ditch it and hand code, but if you stay with dreamweaver, always have a browser window open with your page to see the result.
-
CSS Image replacement advice.
Theres nothing more to suggest than what everyone above me has said, but I will give you one more piece of advice and that is: MOVE AWAY FROM DREAMWEAVER! The code it generates is messy, and come on... Tables... The javascript it generates is not effecient and is very difficult to understand for debugging purposes, and as you seem to have noticed, it makes common speed increasing techniques like CSS sprites hard to do. You will have alot more control over the site if you use code instead of wizards. The site design looks great by the way, some issues obviously but still very good.
-
webstandards
To the last question: that is not entirely true, there are many quality sites out there that don't have valid code, CSS almost doesn't because of the use of CSS 3 techniques that has not been standardised yet, an example of CSS3 would be: -moz-border-radius: 5px Another reason for CSS that is not standardised is when some hacks are used to fix style bugs in the infamous browser Internet Explorer 6, this can be made "valid" to an extent though if they properly use the IE only conditional comments, which prevents the W3C validator from reading it. As for XHTML, many sites are starting to implement HTML 5 techniques without changing the doctype (reason they don't is because older browsers simply don't support it), a common example would be using the custom "data" prefixed attributes that HTML 5 allows but XHTML 1.0 or HTML 4.0 doesn't, example: <button title="This is a Button" data-tool-tip="This is a Button"> Click me </button> As the person above said, validity is important, but at the same time, if you want the code to work, valid code is not always possible.
-
Mootools Iframe addEvent problem
Hello everybody, experimenting with mootools and I decided to build a rich text editor, now I want to do a word count, the word counter works but I need it to update on content update, now the content is inside an iframe, the code snippet I use to create the iframe is as followed: this.IF = new Element('iframe', {'frameborder' : 0, 'src' : 'about:blank'}).addEvent('load', function () { this.DOC = this.IF.contentWindow.document; this.DOC.designMode = 'on'; [b]this.DOC.addEvent('keyup', function() { this.countWords() }.bind(this));[/b] this.toggleView(); this.countWords(); }.bind(this)); The bold line seems to throw an error, Mozilla says this.DOC.addEvent is not a function, now when I done: this.DOC.addEventListener('keyup', function () { this.countWords() }, true); It works... now that simply confused me, can anybody see the problem?
-
firefox document.onkeydown problem
This is an example piece of code which I wish to add to an onkeydown event: function keyListen(param1,param2,e) { // keycode for ie if(window.event) { e = window.event; var keycode = e.keyCode; } // keycode for firefox, safari and opera else { var keycode = e.which; } // if right arrow key was pressed execute a function if(keycode == '39') { someFunction(param1,param2); } } Then somewhere else in my code I dynamically add the function to an onkeydown event like so: document.onkeydown = function() { keyListen(param1,param2,event) }; This works great in Internet Explorer, Opera, Safari and Google Chrome but not Firefox. Firefox keeps reporting that event is not defined, is there a way around this problem? I have also tried this: document.onkeydown = function() { keyListen(param1,param2) }; I excluded the event, but still the same outcome, works well in all browsers apart from Firefox. Please help me, thankyou .
-
Ajax readystate problem
Oh I see, I will try this, thankyou very much :-). **EDIT** Yes Yes thankyou, it now works, I understand now thankyou very much :-)
-
Ajax readystate problem
Hello, of all the coding I've done, AJAX has been something that i've never used before because PHP seems to be my first resort.So being new to AJAX I started at the basic level, I wanted for a test to be able to present the readystate change into a loading image, so basically when ready state is 0,1,2,3 it will show a loading image and when the ready state is 4 it won't show the image. I made a basis script that consists of this code: function getXmlHttpObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } function loading(connection) { var timer = setTimeout(function() { loading(connection); }, 1); var objLoadingImg = document.getElementById('loading-image'); if(connection.readyState === 0) { objLoadingImg.style.visibility = 'visible'; } else if(connection.readyState == 1) { objLoadingImg.style.visibility = 'visible'; } else if(connection.readyState == 2) { objLoadingImg.style.visibility = 'visible'; } else if(connection.readyState == 3) { objLoadingImg.style.visibility = 'visible'; } else if(connection.readyState == 4) { objLoadingImg.style.visibility = 'hidden'; clearTimeout(timer); } } function loadConnection() { var response = getXmlHttpObject(); response.onreadystatechange = loading(response); } Here is a link to the script in action: Script Example The problem is the readystate is always returning 0 and nothing else, I don't think it's a syntax error, probably a logic error, pleae help me.
-
Firefox problem displaying my site
it is not a firefox problem it's an internet explorer problem, always build your sites to firefox standards, because other browsers like google chrome and opera etc will follow the same standards also, then once your site looks good in those browsers do style fixes for internet explorer, yea a link would be helpful please to see the problem.
-
:after and :before, help!?
Thanks for the quick reply, the {display:block;} idea failed i'm afraid, it looks like wrapping it inside a <div> tag will have to be the option, I was trying to avoid it, but oh well , Thankyou.
-
What is Web 2.0 Design?
If you don't have time, I'd be happy to refresh your site design, my rates are low and I take pride in the code I write, if you are interested please email me at hire202@hotmail.co.uk. I do agree with what you sed, the design is simple and very easy to navigate and read. Isn't web 2.0 on how the site is read and processed differently from web 1.0, to javascript and php falls under this catagory, i'm not an expert from it but i don't think css or html standards have changed.
-
Why don´t buttons show themselves as "visited"?
Well done for figuring it out yourself, the site is looking good aswell. I had a little look at your source code, you have used embedded CSS, it's not wrong what you done, but store your CSS in an external css file, the idea of using CSS is to seperate the style from the content which is the HTML. In the long run using an external stylesheet results in a faster loading site, especially when your CSS grows.
-
TUTORIAL: how to center a site using css
ok, Dizi centering site is very simple BUT, what if you wanted the height of the element change as content starts to exceed the height of that element. it's wierd how the browser minds work but all you have to do is add a float to the element... well no, the centering won't work then. So you have to add a div inside that, the same width maybe some padding (remember less width when adding padding) then add a float: left to it, here is an example: THE CSS #wrapper { width: 900px; margin: 0px auto; } /* Centers Content */ #container { width: 880px; padding: 0px 10px; float: left; background: #FFF; } /* Creates an AutoHeight */ THE HTML <div id="wrapper"> <div id="container"> <!-- All Content Goes Inside Here --> </div> </div> Floating is very tricky, but can be handy in cases like this. Something to add, you don't need this: body { text-align: center; } This only centers text, never centers divs. Hope this was a handy extra to Dizi's technique.
-
:after and :before, help!?
Right this was just a basic test, I know if this works then i can apply backgrounds and curved corners etc so here is my code, img { border-left: 1px solid #DDDDD3; border-right: 1px solid #DDDDD3; width: 60px; margin: 5px auto; } img:before { border-top: 1px solid #DDDDD3; height: 1px; width: 60px; content: ' '; font-size: 1px; } img:after { border-bottom: 1px solid #DDDDD3; height: 1px; width: 60px; content: ' '; font-size: 1px; } content: ' '; is to make the sections appear, without anything as content they won't appear even if you put a height on it. The thing is this works with any element like <h1> or <pre> etc, but this won't work with anything like <img> or <input>, so i'm assuming for elements like <img> and <input> it won't work or am I missing something? Please help me , thankyou.