0

In my HTML file I have a div with id="print" and when this div appears on the screen I would like to start function print(). How can I do this?

<div id="print">
</div>

function check(){
//check appear div
}

function print(){
//print data
}
Idris
  • 997
  • 2
  • 10
  • 27
user3357400
  • 397
  • 2
  • 9
  • 26
  • 2
    What do you mean `when this div appear`? That suggests the `div` is initially hidden, but it's hard to be certain. – Marty Mar 06 '14 at 22:27
  • 1
    Is the `div` hidden or do you mean when the `div` is shown in the window? – Aliou Mar 06 '14 at 22:32
  • no it is not hidden, I mean when is shown in the window ... I use reveal.js and you can create slides and when certain slide is shown I want to start print() – user3357400 Mar 06 '14 at 22:41
  • @user3357400, is there any type of event to do that in reveal.js? Have you looked into the documentation? Thanks. – Atutouato Mar 06 '14 at 23:02

1 Answers1

0

like @TheShinyTuxedo suggested this can be resolved by adding a script right after the div is rendered.

look like that:

<div id="print">
</div>
<script type="text/javascript">
   print();
</script>
knightsb
  • 337
  • 3
  • 11