Help with simple javascript using flickrshow

<script src="flickrshow-7.2.min.js">
</script>

<script>
  var cesc = new flickrshow('picturesIframeDiv', {
  autoplay:false,
  interval:7000,
  license:null,
  user:'72247751@N07'
  });
</script>

I need the above code to execute only after i press a button. When i place it directly in a div, it loads up a slideshow from flickr when you open the page. But i need the slideshow to be hidden until a button is pressed. I’ve tried making the div which holds the script visible:hidden; however, the slideshow still pops up. I tried making the div display:none. But the script won’t execute (that is the slideshow never shows up) after i change it back to display:block. So my next step is to find a way for the script to execute one i press a button. How do i code this?