Skip to content

[BUG] lastChild is null Error on dymanical content... #65

@PaykomanVll

Description

@PaykomanVll

Hello,

i like this plugin but now i have a first conflict that i can not solved :(
I use jq owlCarousel and on this section have clamp.js problems :(

<div class="thisCarousel">
    <div class="aucSlidItem">
        <div style="background-image: url('<?php echo IMG_URI; ?>dummy/01.jpg');"></div>
        <div class="clamp"><a id="auc_1" data-mode="win" href="<?php link::get('auction/view?id=%s', ['test_auktion_1']); ?>" onclick="contentWindow( $(this) ); return false;">1Erster Versuch - stilvolles Date langer name</a></div>
        <div>Deutschland<span>xxxx</span></div>
        <div class="auCtn cal" data-end="11/11/2017 16:00:00"></div>
        <div><?php wwmCalc::getAucPrice(999, 'EUR', '["2017-12-18 20:00:00",5.55]'); ?></div>
    </div>
    <div class="aucSlidItem">
        <div style="background-image: url('<?php echo IMG_URI; ?>dummy/01.jpg');"></div>
        <div class="clamps"><a id="auc_2" data-mode="win" href="<?php link::get('auction/view?id=%s', ['test_auktion_2']); ?>" onclick="contentWindow( $(this) ); return false;">2Erster Versuch - stilvolles Date2</a></div>
        <div>Deutschland<span>xxxx</span></div>
        <div class="auCtn cal" data-end="11/11/2017 16:00:00"></div>
        <div><?php wwmCalc::getAucPrice(999, 'EUR', '["2017-12-18 20:00:00",5.55]'); ?></div>
    </div>
    <!-- more items.... -->
</div>
<script type="text/javascript">
$('.thisCarousel').owlCarousel({
    loop: false,
	margin: 20,
	nav: false,
	dots: false,
	autoplay: true,
	autoplayTimeout: 2500,
	lazyLoad: true,
	responsiveClass: true,
	responsive: {
		0: { items: 2 },
		700: { items: 3 },
		1200: { items: 4 }
	}
});
setTimeout(function(){
    var items = document.getElementsByClassName('clamp');
    
    for( i in items ){
        if( items.hasOwnProperty(i) ){
            $clamp(items[i], {clamp: (( items[i].hasAttribute("data-clamp") ) ? items[i].getAttribute("data-clamp") : 'auto')});
        }
    }
}, 1500); 
// result TypeError: a.lastChild is null on getLastchild() #121
<script>

This error is only on browsers without webkitLineClamp

I hope any can help me to fix :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions