html

How to iterate over div?

Hey ppl, i have the following scenary: <div class="maindiv"> <div class="msg">some text</div> ... <div class="msg">some other text</div> </div> I'd like to take the text of each 'msg' class div and translate it using Google API. I've made the following JS function: function translateTimeline(){ var lang ...

How can I make a float top with CSS?

I know that CSS only supports left and right values for the float property, but is there a technique to implement a floating top? I will try to explain. I have the following code: <div style="float:left"> <div style="float:left"> <div style="float:left"> .... With this code every div is floated to left until the right limit of the pag...

Iterating through a html array in javascript

Hi I have sevral selects on my page with the name viewer[]. In javascript I wish to iterate through this array and get each ones selected index. var welements = document.getElementsByName('viewer[]')[0]; for ( var i in welements ) { alert(i.selectedIndex); } I have above but its clearly wrong. I beleive th...

limitations on form element

Hi, I want to know if there is any limitations on the number of form elements in a html page. <form method="post" action="1.php"> <form> <input type="submit" action="2.php"> </form> </form> Is this valid? ...

how to make all options visible in a <select> tag

I need to make a long (>20 options) drop-down list in html, so I use the <select> tag. But over 20 items, Firefox (among others) will add a scrollbar, and I want all the options to be visible. I tried to play with the css overflow property, but it won't work. Any simple html/css solution, before I surrender to Javascript? (note: the si...

Css Html JavaScript - Navigation Highlight current selected Menu

Hello, i think this question is very easy but I don't know if i am right. I am an oldschoool html, php coder. I want to use this kind of navigation: http://www.cssportal.com/horizontal-menus/13styles.htm So far no problem. I got an dynamic php page and i want to use this Menu. There is no problem without this line in the HTML Part: ...

better to use jquery on form submit button?

isnt it better to use jquery for form submit? like: Username: <input type="text" id="username" name="username" maxlength="30" /><br /> Password: <input type="password" id="password" name="password" maxlength="30" /><br /> <input type="button" id="register" name="register" value="Register" /> and then bind the id...

Inner div to scroll if outer div is too small?

Tentatively answered Thanks dcneiner - new answers are appreciated. Hi, I'm trying to make a sidebar which on a website which will have a "panel" in it containing contact info. The problem is that on smaller screens, the text overflows the background. Here is the CSS, where #navigation is the outer div and the inner div is called .in...

Where to begin with Smartphone Web Development?

Ha all, So I've been taksed with developing a smartphone website for our property portal and first thing I did was see what lessons others had to tell online but I've found very little. I'm not building an app, I'm building a website and I'm looking for do's and don't with regards to html, css, widths/heights approaches, javascript (is...

How to move scrollbars automatically

Hello, Steps Get remote data using ajax (jQuery) I Load the data into div with style overflow:auto When I view the page the data is still getting loaded. The scrollbar does not move till the end of the page . How do I move the scrollbar automatically so that the latest data is seen on the web page. Is this possible in Jquery?Pl...

What steps could be taken to avoid cross-browser compatability issues?

Recently, I have been battling with: weird table borders/margins, div alignments, positioning problems, and am having a down right nightmare supporting Internet Explorer 6. I know a lot of you like me are forced to support, IE6-IE8, Web-Kit, and Mozilla based browsers. My questions to you are: What are the important rules you use be...

Switch to SSL using a relative URL

I would like to create a relative link that switches the current protocol from http to https. The last place I worked had something set up on the server so that you could make that happen, but I don't remember much about it and I never knew how it worked. The rationale for this is that I wouldn't need to hardcode server names in files t...

Best practice for building a "Narrow your results" product filtering feature

I'm building a "Narrow your results by" feature similar to Best Buy's and NewEgg's. What is the best practice for storing the user's filter selections in a URL that can be shared/bookmarked? The obvious choice is to simply keep all the user's selections in the query string. However, both of these examples are doing something far more c...

How to get the "value" of a <select> in dojo?

I am using dijit.form.FilteringSelect to provide a way to select values from a . The problem is, when using dojo, the label is returned instead of the value of the s. For example: <select name="test" dojoType="dijit.form.FilteringSelect"> <option value="1">One</option> <option value="2">Two</option> </select> Dojo is returning the lit...

<li> only visible when parent has css class="current"

I have a list of categories called Taxons: The Rails code is here: <div id="taxonomies" class="sidebar-item"> <% @taxonomies.each do |taxonomy| %> <ul class="navigation-list"> <% taxonomy.root.children.each do |taxon| %> <li<%= ' class="current"' if @taxon and ([@taxon] + @taxon.ancestors).include?(taxon) %>><%= link_...

How to make document.body.onmousedown = ContextMouseDown; work in the other browsers?

Hi, The lines below work in IE, what do I have to do so that it works in the other browsers? document.body.onmousedown = ContextMouseDown; document.body.oncontextmenu = ContextShow; Thanks, R. ...

Center float boxes horizontally

I want to display some floating boxes (divs containing thumbnails) and the number of thumbnails depends on the current page width. For example: <div class="container"> <div class="box1" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div> <div class="box2" style="float:left;width:120px;height:120...

Is it possible to override the Subversion HTML pages?

I have a subversion server, providing subversion access via Apache2 and mod_dav_svn The system works fine and clients can access the repositories with SVN client such as TortoiseSVN etc. Users can also access HTML renderings of the same URLs. Can these renderings be over-ridden, or replaced? If so, how would i go about it? ...

double hyphen in script makes firefox render strangely

<!-- <script type="text/javascript">/*<![CDATA[*/ c-- ;//]]></script> --> When I have the above line in the <head> section of a plain html page, Firefox 3.5.5 renders the trailing --> as text. If I change c-- to c- it doesn't. Any ideas what's going on here? I getting an artifact on my pages with this due to a very large script th...

Problems sending html email in php

I'm trying to send an email to myself that has a layout and images. What I'm I doing wrong? <?php $message = $_POST['message']; $emailsubject = 'site.com'; $webMaster = '[email protected]'; $body = " <html> <body bgcolor=\"e7e7e7\"> <style type=\"text/css\"> #body {margin: auto;border: 0;padding: 0;font-family: Georgia, 'Times New ...