开发者

Javascript code to hide div

I would like 开发者_运维技巧to make a reservations formula but I have very low knowledge for javascript and ajax.

Here is a sample form: http://info.airprishtina.com/content/index.php?id=20&no_cache=1&L=0

When you Einfachflug in the Online buchen on the left, the divs that contain the destinations for returning flights disappear. What is the best way to achieve this effect? because I have seen different techniques but I would like to know what is the easiest and the best way!


They change the style.visibility of the objects. That way the hidden objects will still take up space so the form does not change size.

Alternative is to change the style.display between "none" and "" or "block" Here is my example http://jsfiddle.net/mplungjan/VKxFT/

Here is the actual code they use

function OneOrTwoWayClick() {
    var cb = getObject('fbengine_ui_flightsearchext_ascx_MultiCity');
    if (cb != null) {
        var rb = getObject('fbengine_ui_flightsearchext_ascx_Ticket2Way');
        if (rb.checked) {
            getObject('fbengine_ui_flightsearchext_ascx_MultiCityPanel').style.visibility = 'visible';
        } else {
            getObject('fbengine_ui_flightsearchext_ascx_MultiCityPanel').style.visibility = 'hidden';
            cb.checked = false;
            OnClickedMulticity();
        }
    }

    OneOrTwoWayChk();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜