Hidden div does not show properly. Video of problem attached
Problem is hard to explain, so I'll just show you. check out this youtube link.
http://www.youtube.com/watch?v=8NY1KI2iVII
You can see that the divs are repositioning themselves. I have tried removing the effects and the focus() with no success. It works fine in chrome and firefox but not in IE. After some testing It displays only the top <div> correctly. in this case its #business, however if I were to rearrange the <div>'s the one nearest the top would work correctly when selected. Any advice? I'm using IE8.
Here is the offending code.
- <div class="field">
- <label for="location">Location</label>
- <input id="location" name="location" type="text"/>
- </div>
- <div class="field">
- <label for="eventdate">Event Date</label>
- <input id="eventdate" type="text"/>
- </div>
- <div class="field">
- <label for="meethingtype">Type of Meeting</label>
- <select id="meetingtype" name="meetingtype">
- <option value="city_c_meeting">City Council Meeting</option>
- <option value="mayor">Meeting With Mayor</option>
- <option value="councilperson">Meeting With Council Person </option>
- <option value="business">Meeting With Business </option>
- <option value="othermeeting">Other</option>
- </select>
- </div>
-
- <div class="field textbox" id="business">
- <label for="businessname">Business Name</label>
- <input type="text" id="businessname" size="20">
- </div>
- <div class="field textbox" id="othermeeting">
- <label for="othermeetingtype">Meeting Type</label>
- <input type="text" id="othermeetingtype" size="20">
- </div>
- <div class="field textbox" id="councilperson">
- <label for="councilpersonname">Name</label>
- <input type="text" id="councilpersonname" size="20">
- </div>
and the javascript
- $j(document).ready(function()
- {
- $j('.field, input, select, label').focus(function(){
- $j(this).parents('.field').addClass("over");
- }).blur(function()
- {
- $j(this).parents('.field').removeClass("over");
- });
- $j('.textbox').hide();
- $j('#meetingtype').change(function() {
- $j('.textbox').hide();
- $j('#' + $j(this).val()).show("slide",{},1000);
- $j('#councilpersonname, #businessname, #othermeetingtype').focus();
- });
-
- });