Posts

Showing posts from June, 2015

Jquery Fancybox auto display upon page load

Encounter this issue where it is needed to auto pop up Jquery Fancybox item. The solution is very easy. $(document).ready(function(){     $('#myElementId').fancybox().trigger('click'); }); Summary: The main point here this snippet of code: .trigger('click'); which will auto pop up fancybox

Multiple ngApp in 1 page or 1 application

I encounter this issue where there are 2 applications which is totally handled by different ngApp but they want to put them as a same application. After a quick search online, found that actually we can bootstrap the page with different ngApp manually instead of by defining ngApp at body tag. See below sample source for example HTML <!doctype html> <html>     <head>         <meta charset="utf-8">         <title>AngularJS Plunker</title>         <script>document.write('<base href="' + document.location + '" />');</script>         <link rel="stylesheet" href="style.css">          </head>     <body ng-app="HelloWorldApp">         Test 1         <section id="helloworld" ng-controller="HelloWorldController">     ...