Improve js written for guides

* Stop using unnecessary global variable
* Use function defined by jQuery for simplicity
* Fix event listner for "more info button" to handle
  event on resize browser
Merge pull request #11073 from tricknotes/improve-guides-js

Improve guides js