Issue
I need to call a function (which one will open a popup) when my page is loading.
If I want the popup to be open, the function should be called by a user event (a click or something).
I tried to simulate the click
event but it's not isn't working. The function is being called but no click
event has been created.
For example, I tried with angular to do the following:
var element = angular.element("<div ng-click='MyFunction()'></div>");
compiled = $compile(element)(scope);
$timeout(function () {
compiled.triggerHandler('click');
}, 100)
Solution
@IsraGab,when you want an user event when page loads then i think you must go for onmouseout Event for body element.
here is plunker
link:
Plunker
Answered By - Shikha thakur
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.