jquery - div id doesn't work as class -
so i've been having problem days. i've googled half of internet. changed code zilion times. had many times. can't seem make work or understand.
i changed 1 of css ids class, because need use more once in 1 page. , stopped working. works when it's id. search think has specifity, i've tried alot of things , still works id.
the problem .carousel_dots
here's fiddle: http://jsfiddle.net/b2y8e/1/
html:
<div class="panel" title="desiree charms" id="desiree_charms" style="overflow: hidden;" data-appbuilder-object="page"> <div class="carousel"> <div class="carousel_page"> <h2>desiree charms</h2> <p><img src="images/desiree_charms.jpg" style="width: 85%; height: 85%; display: block; margin-left: auto; margin-right: auto " data-appbuilder-object="image" class="" title=""> </p> </div> <div class="carousel_page"> <h2>page two</h2> <p>text , images page 2 goes here. swipe go next page.</p> </div> </div> <div class="carousel_dots"></div> </div>
css:
.carousel { overflow:hidden; margin:0 -10px; } .carousel_page { overflow: auto; -webkit-scrolling:touch; padding:0 10px; } .carousel_dots { text-align: center; margin-left: auto; margin-right: auto; clear: both; position:relative; top:0; z-index:200; } .carousel_paging { border-radius: 10px; background: #ccc; width: 10px; height: 10px; display:inline-block; } .carousel_paging_selected { border-radius: 10px; background: #000; width: 10px; height: 10px; display:inline-block; } .carousel h2 { text-align: center; }
it's carousel mobile app. 1 https://github.com/krisrak/appframework-templates/blob/master/template-carouselviewapp.html
so think problem in piece of code in jquery
// create paging dots if (this.pagingdiv) { this.pagingdiv.innerhtml = "" (i = 0; < this.childrencount; i++) { var pagingel = document.createelement("div"); pagingel.id = this.container.id + "_" + i; pagingel.pageid = i; if (i !== this.carouselindex) { pagingel.classname = this.pagingcssname; } else { pagingel.classname = this.pagingcssnameselected; } pagingel.onclick = function() { that.onmoveindex(this.pageid); }; var spacerel = document.createelement("div"); spacerel.style.width = "20px"; if(this.horizontal){ spacerel.style.display = "inline-block"; spacerel.innerhtml = " "; } else{ spacerel.innerhtml=" "; spacerel.style.display="block"; } this.pagingdiv.appendchild(pagingel); if (i + 1 < (this.childrencount)) this.pagingdiv.appendchild(spacerel); pagingel = null; spacerel = null; } if(this.horizontal){ this.pagingdiv.style.width = (this.childrencount) * 50 + "px"; this.pagingdiv.style.height = "25px"; } else { this.pagingdiv.style.height = (this.childrencount) * 50 + "px"; this.pagingdiv.style.width = "25px"; } } this.onmoveindex(this.carouselindex); } }; return carousel; })();
somehow worked id not class
Comments
Post a Comment