Jump to content

yaragallamurali

Members
  • Posts

    89
  • Joined

  • Last visited

Posts posted by yaragallamurali

  1.  

    Hmmm... it worked for me in FF23 but I see it doesn't work in IE9.

     

    The only thing I can seem to get working in IE9 is color... but this affects the item in the list.

    function setfont(e){var n = e.selectedIndex;for(var i=0 ; i<e.length ; i++){if ( i==n ){e[i].style.color = 'red';}else{e[i].style.color = 'black';}}}

    color and background-color are only the properties that we can apply for options and nothing else can be applied if we want to have consistency across browsers. So applying font seems to be impossible in all the browsers.

  2.  

    What you seem to be saying is that the dropdown shows all the options but you want the currently selected option to be a different font so that if you open up the dropdown again the currently selected option will be obvious.

     

    I think you would need Javascript for that.

    <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Choose</title><style>.sel{font: italic bold 14px/30px Georgia, serif;color: red;}</style><script>function setfont(e){var n = e.selectedIndex;for(var i=0 ; i<e.length ; i++){if ( i==n ){  e[i].className = 'sel';}else{  e[i].className = '';}}}</script></head><body><h3>Choose:</h3><select onchange="setfont(this);">  <option value="volvo">Volvo</option>  <option value="saab">Saab</option>  <option value="mercedes">Mercedes</option>  <option value="audi">Audi</option></select> </body></html>

    This does not work. I have checked it. I also have red some docs and they says that setting the font to the options of select tag is not possible. It might work in some and may not in remaining browsers. One more clarification is you got my question wrong. What i want is the visible text in the select box should be in different font but all the options in the drop down should be in normal font.

  3. Off hand I'd say font-family, but you should post your relevant code using the code tags. Else, we're just guessing.

    If i use the above said style to the <select> tag it applies to all the options but my requirement is different. only the text that is visible , i mean selected text should have a different font. when clicked on the dropdown when all the other options are shown they should have a different font, may be normal font size.

  4. Hi the problem is defining the font only to the text displayed in the dropdown. In detail when we click on the drop down it shows all the available options. these options should have normal or default font size but when i select an option that gets displayed in the dropdown. so this displayed text should have a different font size. Is this possible. if so what is the css for this?

  5. hi i have seen a code snippet on some site. It says with the following code snippet we can find the browser manufacturer.

     if (jqcc.browser.msie) {//it is IE};

    My confusion is about "jqcc". what is "jqcc"?

  6. that's what I was trying to say. They are not fully implemented in all browsers, but are part of the HTML5 spec.

     

    For the sake of progressive enhancement, you can use FileReader if its available, or another alternative if it's not.

    I think for html5 to be implemented fully, it will take sometime. No browser is supporting it to the full extent.

  7. Why does AJAX need an iframe in this case but not other cases?

    I think ajax is not required in this approach. Normal javascript is enough. Ajax cannot read files from hard disk nor can handle binary data. Not only uploading binary data you cannot even get the binary data using ajax. you can only get text or xml using ajax but while uploading you cannot upload anything using Ajax. I hope this helps.

  8. You can't use Javascript to do that, because Javascript doesn't have access to read the file that you're trying to upload. In order to perform an upload that simulates ajax functionality, the common solution is to add a hidden iframe to the page, submit the form normally to that iframe (so the page doesn't reload), and put a load handler on the iframe to capture the server's response and send that back to Javascript.

     

    Hi i have the same kind of requirement. I am not able to understand clearly what you are saying. up to adding an hidden iframe is ok. what do u meant by "submit the form normally to that iframe" ? do you mean to say submit the form through the iframe or something else. how can we submit the request to the iframe which is on the same page. can u provide some more explanation. if possible some sample code. It will be so much help full to me. Thanking you so much.

    • Like 1
  9. there is a problem. if display=none then the div's are not visible in the browser. I don't want this to happen. Even when everything is being displayed only a particular div should get printed. My most concern is the view in the browser should not change because of printing. Is there any good solution for this?

  10. Hi I have 5 div tags in my html page and there is a print button. when i click on the print button it has to print only a particular div. for example it has to print the 2nd div which contains some personal information. It should not print the rest of the page. Only the content of the 2nd div should be printed. how to achieve this?

  11. Now i found the problem and solution. The problem is because of border style and border width. if i apply the following style "border:1px solid" everything works fine. The main element is border-style. If we apply border-style then everything is fine in combination there should not be "border-width:0px". In this situations everything is working fine. One more note is "border-style" should not be "none" or "hidden".Now my question is if i dont want to apply borders, I mean if i dont want to display border lines on html how do i achieve this?

  12. Hi the following is my code and i am using crome (browser)

    <div style="width:700px;height:100px;background-color:silver">        <div id="week" style="margin:20px;border:2px solid red">                 <div id="sfsf" style="margin:10px;">                          Select Day Of The Week                 </div>		           </div>  </div>

    In the above code the div with id "week" is displaying very strange behavior. For this div i have applied margin of 20px. the margin should start from its parents div. But here the margin starts from the top of the document, I mean from the browser top. this is very strange. there is a div inside the "week" div. For that also i have applied margin of 10px. This is working fine. I mean the margin starts from the "week" div. Could you please help understanding this behavior? How to solve this?

  13. Thank you for replying. Without using "position:relative" it is not possible to move the div from left or top. to reduce its width we can use "float". The final answer about solving re sizing is nice. Thanks for that.

  14. Hi the following is my code:-

    <div style="height:50px;background:#F75D59;">           <div style="position:relative;font:bold 20px arial;color:white;float:left;left:50px">GOOGLE </div>           <div style="position:relative;float:left;left:200px;">                    <input type="text";text size="50px">                    <input type="button" title="search">            </div>            <div style="position:relative;float:left;left:500px;color:white"> UUUUUUUU </div>            <div style="position:relative;float:left;left:500px;">                     <input type="button" color="#ff0000"value="1">                     <input type="button" button size="10px" value="+share">                      <img src="a.png"height="20px";width="20px">            </div></div>

    The problem with the above code is when the browser gets re sized the parent div, I mean the top most div is getting re sized according to the browsers width. But the child div's are not getting re positioned accordingly. so when the browser is re sized the page looks awkward. So how to resolve this?

×
×
  • Create New...