I found many posts talking about stop native browser datepicker. But all of them have long and complicated solutions. Can I have just simple solution to do that?
<input type="date">
Or you may help me in understand the answer here
Related
None of the bind examples in the documentation work - https://fancyapps.com/docs/ui/fancybox/api
The standard constructor examples work great, but anything that requires binding does not work. There is no error, but the gallery lightbox doesn't work - clicking an image just opens the image as a link. Here is the exact example code with markup:
<div id="gallery">
<a href="https://lipsum.app/id/1/800x600">
<img src="https://lipsum.app/id/1/300x225" />
</a>
<a href="https://lipsum.app/id/2/800x600">
<img src="https://lipsum.app/id/2/300x225" />
</a>
</div>
<script>
Fancybox.bind("#gallery a", {
on : {
ready : (fancybox) => {
console.log(`fancybox #${fancybox.id} is ready!`);
}
}
});
</script>
That console log never fires.
I'm importing FancyBox like this:
import { Fancybox } from '#fancyapps/ui';
I've tried searching around, but very little info on FancyBox 4 other than official docs and it's frustrating as they don't work. I've tried some of the examples in showcase also, and the same deal. If it's binding, it won't work and no errors are shown. Anyone have any insight into this?
Thanks,
Tom
It works perfectly fine. Since you did not provide a live demo (or at least a full HTML code), then it just not possible to help you.
It is so frustrating to read comments like this, no demo, no useful info, nothing. Maybe you did not include JS file, I do not know ... I would love to help you and to improve documentation, but, sorry, your comment is not helpful at all.
Fancybox is designed to be as easy to use as possible, all you have to do is:
Include two files - CSS and JS file (to get Fancybox object).
Add data-fancybox attribute to your links (or to call Fancybox.bind("YOUR_SELECTOR");)
Thats it! It can not be any simpler.
Sorry, it should have been a much clearer question. I didn't include a demo because it's a big wordpress site in production. It was giving me no useful feedback or errors or anything like that. I build websites day in and day out, so assumed it wasn't just me making some incredibly stupid mistake like a typo or something. I genuinely spent a lot of time on this, it wasn't me being lazy and just posting on stack overflow straight away...
It was me being stupid though.
In the process of making a demo to show you, I found the problem and (as you already know!) it's my mistake. I was able to make fancybox work by instantiating it straight away in my js, but binding (and therefore galleries etc) was not working.
The reason was the javascript was included in the head of the html document before the markup instead of at the bottom of the html document before the closing body. There was nothing for the js to bind to when it was executed.
I wouldn't normally include javascript in the head either but it's a wordpress project and because of some plugin, it's required there. Fancybox 3 worked with js in the head, but I suspect it might be jquery being more forgiving than native js with it's binding to DOM elements?
So, yes, entirely my fault. I was following the steps of the installation and startup guide almost exactly, but that inclusion of the js file in a slightly unusual (or bad practice at least) place was what caused all the issues.
I have seen some similar questions to mine , but most of them have some code related issue that prevents them from work... In my vase the form submit works well in safari, chrome , firefox
But in the internet explorer version i click the submit button and it doesn't do anything.
Initially i thought it might be a networking problem , or maybe an html problem ? But it doesn't make sense to detect a click and not do the action.
What could possible be the problem ? since the difference between browsers is basically the way they read the html right ?
I'm interested in learning more about this issue !
Thanks in advance !!!
Fixed the problem by changing the <button> </button> tag to an <input type="submit">
maybe that's not a propper solution but it worked for me !!
Hope it helps someone!!
Please have a look on fiverr.com's page. they have sign in/register buttons that pop up and darkens the page behind it.
Any suggestions for this functionality on Wordpress? I'd be happy to pay for a good plug in!
Just as a reference - I do not use WordPress, but I am almost certain this functionality is in it somewhere. To answer at the heart of your question though using other means...
You can absolutely do this using CSS/jQuery/PHP. Here is a link to get you started on a tutorial. There is also a number of other tutorials for this with simple google searches.
https://codyhouse.co/gem/loginsignup-modal-window/
As for darkening the background, you should be able to do that using CSS/jQuery for the on-click/open events.
For a specific wordpress solution, I believe this might be what you are looking for but to be frank, I have very little experience with WP so can't confirm it is correct.
https://en-ca.wordpress.org/plugins/tags/login-dialog
Best of luck!
and thank you in advance. I am experiencing an issue with Google Chrome today. I have made the decision to implement a JS plugin called awesomplete, it is a autocomplete plugin. The plugin works wonderful in every browser except for Google Chrome. The plugin works, except Google Chrome is ignoring my autocomplete="off" pleas and throwing in its own suggestions which, of course, appear OVER the awesomplete's generated content.
Whenever I type into my input, Google Chrome automatically creates a menu below the input, exactly as if there was a datalist attached to the input (which there isn't). This false "datalist" appears over the awesomplete suggestions making the plugin useless. I have searched and searched without success. I have tried both autocomplete="false" and autocomplete="off" on the form, and on the input. I also have aria-autocomplete="off" on there even though I'm not sure what that does. I have even tried a suggestion from others to put to "fake" inputs at the beginning of the field, so that Google Chrome's autocomplete feature will attack them instead of the real input. Yeah, no go.
Most of my users are using Google Chrome, so this is a problem for me. Is there anything I can do? Or I'm I left helplessly powerless to the browser, who for some reason the devs decided to take form matters into their own hands.
<input required type="search" data-list="<?php echo $list; ?>" class="awesomplete" name="gameSearch" size="50" placeholder="Search for game titles here!" autocomplete="off" aria-autocomplete="list">
$list is a generated list of game titles courtesy of some php before the input.
Any advice or help is greatly appreciated...
I am pretty much sure chrome does it by matching the 'id'/'name'. At this point of time, I guess there is no solution other than removing them off your datalist.
I've seen many different suggestions for fallbacks for browsers who don't fully implement html5 forms (solutions involving Modernizr, YepNope, Jquery validate...) but I haven't managed to get anything to work effectively.
Essentially apart from adding a datepicker which I've managed to get going with Modernizr and JQuery datepicker all I really need to do is get the validation to work in all browsers (main priority is the email validation)
Chrome and FF everything seems to work natively, yet surprisingly Safari validates without a proper email address. IE obviously doesn't support it either
Could anyone help with a reasonably straightforward fallback (probably via Modernizr)?
Thanks
Have you tried webshims lib? It's build on top of jQuery and I have implemented the forms chapter of HTML5 very accurately. You can find a list of supported attributes, properties and methods on the webforms site of webhims lib.
I would like to have some feedback on this.
cheers
Alex
Keeping in mind that proper validation should be done server-side, you can easily plug one of the many jQuery validation plugins.