I am using pdf js https://github.com/latuminggi/pdf.js_readonly/ to render pdf in my website .Here the viewer.html helps to render the pdf url:https://github.com/latuminggi/pdf.js_readonly/blob/master/generic/web/viewer.html
in our project url will be : localhost/project/generic/web/viewer.html?file=pdfname.pdf
And the code in the viewer.html to render pdf is
<div id="viewerContainer" tabindex="0">
<div id="viewer" class="pdfViewer"></div>
</div>
here in #viewer there pdfjs will read the document and make child divs like
view live example in : https://latuminggi.github.io/pdf.js_readonly/generic/web/viewer.html
<div id="viewerContainer" tabindex="0">
<div id="viewer" class="pdfViewer">
<div class="page"> <div>
<div class="page"> <div>
.... ....
<div class="page"> <div>
<div class="page"> <div>
</div>
</div>
i wanted to do is to add an ads image after each 5 pages like .
<div id="viewerContainer" tabindex="0">
<div id="viewer" class="pdfViewer">
<div class="page"> <div>
<div class="page"> <div>
<div class="page"> <div>
<div class="page"> <div>
<div class="page"> <div>
<div class="ads"> <img src="path"> <div>
<div class="page"> <div>
<div class="page"> <div>
<div class="page"> <div>
<div class="page"> <div>
<div class="page"> <div>
<div class="ads"> <img src="path"> <div>
<div class="page"> <div>
<div class="page"> <div>
</div>
</div>
I dont know much about pdf.js so i asked here
Related
My website is
meesbuschman.com
The buttons work just fine on desktop, but on my android phone the buttons don't seem to work. It might be the fact that I'm using transitions or transform on my css, but I'm not possitive. I couldn't find anything on stack overflow.
$('#projectsBtn').click(function(){
setWhite();
growLogo();
animateInfo(1);
$('header').css('height', '20vh');
$('.second-half').css('height', '80vh');
$('.nav').css('transform', 'translateY(-100%)');
$('.projects').css('transform', 'translateY(0)');
});
<div class="nav">
<div class="btn" id="skillBtn">
<div class="small-border-bottum"></div>
<div class="small-border-left"></div>
<div class="small-border-top"></div>
<div class="small-border-right"></div>
<h2>My Skills</h2>
</div>
<div class="btn" id="projectsBtn">
<div class="small-border-bottum"></div>
<div class="small-border-left"></div>
<div class="small-border-top"></div>
<div class="small-border-right"></div>
<h2>Projects</h2>
</div>
<div class="btn" id="aboutBtn">
<div class="small-border-bottum"></div>
<div class="small-border-left"></div>
<div class="small-border-top"></div>
<div class="small-border-right"></div>
<h2>About me</h2>
</div>
</div>
<div class="skills">
<div class="btn" id="homeSkillBtn">
<div class="small-border-bottum"></div>
<div class="small-border-left"></div>
<div class="small-border-top"></div>
<div class="small-border-right"></div>
<h2><i class="ion-chevron-up"></i></h2>
</div>
I'm using scrollmagic to display content in a project I'm currently working on. The design I have uses 'wedges' at the top and bottom of the containers. I have managed to achieve the result that I want using an svg for the 'wedge' and by sticking the first one to the top of the page with a z-index: 1;
As a result this layer overlays the rest of the content that subsequently follows. Please see the codepen below.
http://codepen.io/oliver_randell/pen/MyLNON
I really need to be able to click the buttons in the promo boxes!
Any help would be greatly appreciated.
<section id="intro" class="intro">
<div class="content">
<div class="row">
<div class="medium-10 medium-offset-1 large-8 large-offset-2 columns">
<div class="fade-trigger"></div>
<h2>Intro title</h2>
<h3>Intro Subtitle</h3>
<p>Some extract text</p>
</div>
</div>
</div>
</section>
<section class="promo-boxes">
<!-- THIS IS WHERE THE TOP WEDGE NEEDS TO SIT -->
<div id="pinned-trigger1">
<div id="pinned-element1">
<div class="top-wedge"></div>
</div>
</div>
<!-- BOX 1 -->
<div id="pinned-trigger2" class="promo box1 full-screen">
<div id="pinned-element2">
<div class="wrapper">
<div class="content">
<div class="img-container">
<div class="img" style="background-image: url('https://unsplash.it/800/800');"></div>
</div>
<div class="text">
<div class="row">
<div class="large-4 large-offset-8 columns">
<div class="valign-middle">
<div>
<h3>Title</h3>
<p>Text</p>
Button
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="pinned-trigger4" class="promo box3">
<div class="content">
<div class="img-container">
<div class="img" style="backgroundimage:url('img-link.png');">
</div>
</div>
<div class="text">
<div class="row">
<div class="large-4 large-offset-8 columns">
<div class="valign-middle">
<div>
<h3>Title</h3>
<p>Text</p>
Button 2
</div>
</div>
</div>
</div>
</div>
</div>
<div id="pinned-element4">
<div class="bottom-wedge show-for-large"></div>
</div>
</div>
</section>
<section class="next-section full-screen">
<h2>this is the next section</h2>
</section>
So... I just added:
#pinned-trigger1 {
position-events: none;
}
And voila!!
I use JQuery Smooth Div Scroll. In html
<div id="makeMeScrollable">
<div class="queuenum">10</div>
<div class="queuenum">20</div>
<div class="queuenum">30</div>
<div class="queuenum">40</div>
<div class="queuenum">50</div>
<div class="queuenum">60</div>
<div class="queuenum">70</div>
<div class="queuenum">80</div>
<div ng-show="ishow" class="queuenum">90</div>
<div class="queuenum">10</div>
<div class="queuenum">20</div>
<div class="queuenum">21</div>
<div class="queuenum">12</div>
<div class="queuenum">13</div>
<div class="queuenum">14</div>
<div class="queuenum">15</div>
<div class="queuenum">17</div>
<div class="queuenum">19</div>
<div class="queuenum">14</div>
<div class="queuenum">88</div>
</div>
It work well.
But I load dynamic data by angularjs. It not work
<div id="makeMeScrollable" ng-repeat="order in currentlist1" class="row">
<div class="queuenum">{{order.queue}}</div>
</div>
Please help me.
Thanks for trying to help! I'm having an issue with the following code when the page initially loads. The div class 'highlights', which contains the divs 'box' and 'box-2', jumps around the page when loading. I suspect is has something to do with the social media buttons running javascript above the divs but cannot figure out how to get everything to stay still. Here is a link to the site. Thank you all for helping!!
<div class="buttons">
<div class="fb-share-button" data-href="http://www.powerrankingsguru.com/MLB/2015-MLB- power-rankings/week-18.html" data-layout="button_count">
</div>
<div class="twitter-button">Tweet
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s) [0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)) {js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<div class="g-plus" data-action="share" data-annotation="bubble" data- href="http://www.powerrankingsguru.com/MLB/2015-MLB-power-rankings/week-18.html"> </div>
</div>
<div class="highlights">
<div class="box">
<div class="box-header"><p>What to Watch</p></div>
<div class="box-content">
<div class="game-details">
</div>
<div class="game-overview">
<div class="away-team">
<div class="away-team-logo">
<img src="../../Images/MLB/Los_Angeles_Dodgers_75px.gif">
</div>
<div class="record">
<h6>Dodgers</h6>
<h6 class="lighter">(60-45)</h6>
</div>
</div>
<div class="home-team">
<div class="home-team-logo">
<img src="../../Images/MLB/Pittsburgh_Pirates_75px.gif">
</div>
<div class="record">
<h6>Pirates</h6>
<h6 class="lighter">(61-43)</h6>
</div>
</div>
<div class="symbol">#</div>
</div>
</div>
<div class="date">
<h4><span class="left">Fri Aug 7th - Sun Aug 9th</span></h4>
</div>
</div>
<div class="box2">
<div class="box2-header"><p>Biggest Movers</p></div>
<div class="rise">
<div class="rise-up"><img src=../../Images/arrowGW.gif></div>
<div class="rise-number"><p>5</p></div>
<div class="rise-team"><img src="../../Images/MLB/Toronto_Blue_Jays_75px.gif"></div>
</div>
<div class="fall">
<div class="fall-down"><img src=../../Images/arrowRW.gif></div>
<div class="fall-number"><p>5</p></div>
<div class="fall-team"><img src="../../Images/MLB/Atlanta_Braves_75px.gif"></div>
</div>
</div>
</div>
If you're okay with using javascript you could hide your container box with display: hidden and then in a javascript onload function you would set the display back to block.
Div:
<div id="highlightDiv" class="highlights" style="display: hidden">
...
</div>
onload:
window.onload = function() {
document.getElementById("highlightDiv").style.display = "block";
}
i am having the div structure like this, which will be like children-grandchildren-great grand-children and so on repeatedly as the div structure end is unknown. so my question is How to traverse recursively until the last div.
<div class="parent">
<div class"con">
<div class="app">
<div class"con">
<div class="app">
<div class"con">
<div class="app">
<div class"con">
<div class="app">
</div>
<div class="disapp">
</div>
</div>
</div>
<div class="disapp">
<div class"con">
<div class="app">
</div>
<div class="disapp">
</div>
</div>
</div>
</div>
</div>
<div class="disapp">
<div class"con">
<div class="app">
</div>
<div class="disapp">
</div>
</div>
</div>
</div>
</div>
<div class="disapp">
<div class"con">
<div class="app">
<div class"con">
<div class="app">
</div>
<div class="disapp">
</div>
</div>
</div>
<div class="disapp">
<div class"con">
<div class="app">
</div>
<div class="disapp">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I found a solution like this - Jquery tree traversal - Nested Unordered list elements to JSON, but here list tag is only processed but in my case I want all the div to be processed as JSON.
if you can use jQuery, then you could just do something like $(".parent").find( div:last'). If you want to do it for each level, then you'd have to $(".parent" ).find( "div" ).each(... and traverse that way