0

HTML Part

<a class="btn ban-default loginsignupbutton" href="#" data-featherlight="#fl1">Login/Signup</a>


<div class="lightbox" id="fl1">         
<h2>Login</h2>
<input name="loginuserphone" placeholder="MOBILE NUMBER" type="text">
<input name="loginuserpassword" placeholder="PASSWORD" type="password">
</div>

What I want to do:

actually the basic script is working fine, when user clicks on the button, the lightbox popup is coming... but I want to AUTO open the popup, on page loads.

I Tried

$('.loginsignupbutton').trigger('click');

did't worked, then i tried.

$('a.loginsignupbutton').featherlight({
  openTrigger:    'click',
});    

did't worked.

Any help is appreciated.

Yogesh M
  • 25
  • 4
  • Does `(!!$.cookie('token')` condition satisfy? – Guruprasad J Rao May 03 '16 at 04:14
  • Yes, i actually got that solution from http://stackoverflow.com/questions/6362688/jquery-check-if-cookie-exists-if-not-create-it#comment36632491_23344706 – Yogesh M May 03 '16 at 04:31
  • Just keep an alert inside `if` and check if it is passing? – Guruprasad J Rao May 03 '16 at 04:32
  • @GuruprasadRao oops, that function seems not be working. but still i tried just to trigger it from JS. like leaving the cookie part, just want to show that popup when page loads. even that didn't worked :( – Yogesh M May 03 '16 at 04:36
  • can you try setting up an example `fiddle`? – Guruprasad J Rao May 03 '16 at 04:45
  • @GuruprasadRao, sorry for the delay, here it is - http://codepen.io/wooranker/pen/vGQQex – Yogesh M May 03 '16 at 09:06
  • Expecting it **[`like this`](http://codepen.io/kshkrao3/pen/qZQQvR)**? – Guruprasad J Rao May 03 '16 at 09:49
  • @GuruprasadRao, thanks a lot :D if you are from featherlight.js and you got donate button, let me know. i'l more happy to done some thing. one more kind request, do featherlight.js has any ONCLOSE function ? and if possible can you kindly please implement it in that codepen, like an alert box ONCLOSE... please. – Yogesh M May 03 '16 at 10:24
  • Sorry @Yogesh.. am not that smart to build a plugin.. Just having basic knowledge on `jquery`.. Instead of onclose you have `afterClose` event. You need to look into the **[`configuration options`](https://github.com/noelboss/featherlight/#configuration)** provided by them so that you'll get some idea.. – Guruprasad J Rao May 03 '16 at 10:39
  • **[`Something like this`](http://codepen.io/kshkrao3/pen/qZQQvR)** – Guruprasad J Rao May 03 '16 at 10:42
  • @GuruprasadRao, i actually tried this - http://codepen.io/wooranker/pen/VaVVxp :) ofcource not worked at all. ;) do you mind ? are you on upwork or freelancer ? :D – Yogesh M May 03 '16 at 10:54
  • Am working in a company cum `freelancer` too. I hope demo given in my last comment is what you are expecting.. – Guruprasad J Rao May 03 '16 at 11:24
  • @GuruprasadRao if you can share your upwork profile ;) that might help me to pay you for the work done! :) or to hire you in future to work together – Yogesh M May 03 '16 at 11:31
  • Sorry Yogesh.. No upwork profile yet.. Have to create one.. If possible let me know if there are any other ways we can connect.. – Guruprasad J Rao May 03 '16 at 12:13
  • skype ? can i have your Skype ? you can delete the comment after I added you ;) – Yogesh M May 03 '16 at 12:24
  • @GuruprasadRao, let me know if you are comfortable with freelancer, you can share that profile :) – Yogesh M May 03 '16 at 15:48
  • any help with this is highly appreciated.. is there any chance to get an ALERT box ONCLOSE, without changing anything in html part... http://codepen.io/wooranker/pen/VaVVxp – Yogesh M May 04 '16 at 00:59
  • **[`Like this`?](http://codepen.io/kshkrao3/pen/ZWVYVL)** – Guruprasad J Rao May 04 '16 at 03:32
  • @GuruprasadRao, do take time and check your freelancer inbox message and reply me over there bro! – Yogesh M May 04 '16 at 10:43

0 Answers0