开发者

Can't select unknown attr's with jQuery in IE7

开发者 https://www.devze.com 2023-02-25 00:52 出处:网络
Each time i try to select a div element with the following selector: div#wl-add-position-steps div[data-step=\"1\"]

Each time i try to select a div element with the following selector:

div#wl-add-position-steps div[data-step="1"] 

IE7 can't update the returned object.

jQuery('div#wl-add-position-steps div[data-step="1"]').hide();
jQuery('div#wl-add-position-steps div[data-step="2"]').show();

HTML:

<div id="wl-add-position" style="display:none;">
    <div class="wl-description">
        <?php echo $this->translate('wlPositionAddDescription'); ?>
    </div>
    <div id="wl-add-position-steps" class="wl-steps cf">
        <ul>
            <li data-event-step="1" class="active"><span class="a-step"><?php echo $this->translate('stepX', 1); ?></span><?php echo $this->translate('wlPositionStep1'); ?></li>
            <li data-event-step="2"><span class="a-step"><?php echo $this->translate('stepX', 2); ?></span><?php echo $this->translate('wlPositionStep2'); ?></li>
            <li data-event-step="3"><span class="a-step"><?php echo $this->translate('stepX', 3); ?></span><?php echo $this->translate('wlPositionStep3'); ?>
            </li>
        </ul>
    </div>
    <div id="wl-add-position-steps">
        <div data-step="1">
            <input type="text" class="wl-search-full" id="wl-search-instrument" value="WKN/ISIN/Kürzel/Name" />
            <ul data-block="instruments" class="开发者_StackOverflowwl-result-list box twoline activites"></ul>
            <span data-block="nothing-found" style="display:none;">
                <br /><br />
                <img src="/common/img/watchlist-emptylist.png" align="center" class="search-no-warpper" />
            </span>
        </div>
        <div data-step="2" style="display:none;">
            <h3>
                <?php echo $this->translate('wlPostionAddStep3Title'); ?>
            </h3>
            <ul data-block="quoteSources" class="wl-result-list exchanges"></ul>
        </div>
        <div data-step="3" style="display:none;">
            <div class="modal-form-position">
                <div class="cf">
                    <label for="wl-instrument-name"><?php echo $this->translate('value'); ?></label>
                    <input type="text" name="wl-instrument-name" id="wl-instrument-name" readonly value="" />
                </div>

                <div class="cf">
                    <label for="wl-quotesource-name"><?php echo $this->translate('quotesource'); ?></label>
                    <input type="text" name="wl-quotesource-name" id="wl-quotesource-name" readonly value="" />
                </div>

                <div class="cf">
                    <label for="wl-instrument-value"><?php echo $this->translate('buyCourse'); ?></label>
                    <input type="text" name="wl-instrument-value" id="wl-instrument-value" value="" />
                </div>

                <div class="cf">
                    <label for="wl-position-date"><?php echo $this->translate('date'); ?></label>
                    <input type="text" name="wl-position-date" id="wl-position-date" value="<?php echo date('d.m.Y'); ?>" />
                </div>

                <div class="cf">
                    <label for="wl-position-comment"><?php echo $this->translate('comment'); ?></label>
                    <textarea id="wl-position-comment"></textarea>
                </div>
            </div>
        </div>
    </div>
</div>

Is this a known problem or just another problem?


Ok the problem is simple to fix. IE7 can't read direct children() of an element. So the selector can't get the element div#wl-add-position-steps>div[data-step="1"]. With the select: [data-step="1"]. The issue is corrected!

0

精彩评论

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