Implement hover behavior for both desktop and iPad [closed] - javascript

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am trying to implement a main-tab which on hover would show sub-tabs
<img src="images\img_Classes.png" />
function displaySubTabs(parentTabId, childTabId) {
$('#' + parentTabId).children().removeClass('show');
$('#' + childTabId).addClass('show');
}
I need to implement the same thing on iPad as well.
Now as onmouseover is not supported on iPad, I need to add onclick as well (Now this can be changed to ontouchstart as well)...But the point is I feel like unnecessarily I am adding 2 handlers..
Is there any way by which I can implement this behavior using a compact way.
I am open to all ideas including moving the implementation from JS to CSS. Anything which is more compact and good approach..
Please suggest.

I would suggest that you exclude your hover functionality entirely for the mobile platform version. Reason being that you explain, it just doesn't work. Just leave the sub menus open, and have them change in accordance to the main tab thats being interacted with.

Related

How can i do that in javascript? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
My picture
About my issue. Please help me! Thank you very must.
I doubt you're going to get a good answer give the vagueness of your question, but I'll give you a start. For one, you could use one of several good sliders that exist. For a start, I'll recommend three that I really like: Slidr, Slick, and Flickity.
The second option is that you could build a custom slider of sorts. Now, given the way you've asked the question, I am going to assume you don't want to do this. Nonetheless, you could stack all of the slides on top of each other and use CSS transforms to slide them in from different directions simply using translateX(), and triggering these animations using event listeners on click. This is obviously a very stripped down explanation, but is essentially what a very simple slider like Slidr does.

Jquery scrolling effect [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I know this is a place for posting questions regarding the code issues but please can anyone help me out with this I need a scrolling jQuery effect like when we are on that section like if portfolio section is active then the content start scrolling automatically like in this website section number 4 what jQuery I have to use at http://stampsy.com. Can anyone help me out, please?
I'm confused by your question but I think you want the picture slide effect?
If so, I would recommend using the bootstrap Carousel, should give you what you need.
EDIT:
For the section number 4 just use the CSS scroll effects.

Best way to create a parallax, CSS or js? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am making a website with a parallax header. This header needs to contain both images and video. I wanted to make a pure css approach, however that creates new "problems".
I tried http://keithclark.co.uk/articles/pure-css-parallax-websites/
Problems CSS:
- You have to put the whole page in a scrollable div with a 100% viewport height, this means that native ipad scrolling behaviour is not working anymore, things like js scrollTop are not working anymore, fixed navbars are displayed over the scrollbars and so on. See demo of this here http://keithclark.co.uk/articles/pure-css-parallax-websites/demo3/
Problems JS:
- Performance, animation looks jumpy most of the time
- Needs a lot more code
- Needs extra code to make video behave like a fixed background
I really do not want to use any third-party plugins, to prevent a "plugin overkill" for this website.
I am now at a point where I have to choose to go on and keep the CSS version or to go with javascript. What I am just curious about, is what is the best way coding wise, performance wise, to make a parallax? Hope someone can enlighten me on this.
Thanks!

track eye by tracking.js [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I recently found recently the JavaScript library - tracking.js
Is there any way to detect what div I see now by image or camera?
I have two elements on the desktop, the left and right columns, and I would like to check if I see left div ( with console.log() ) or right div. This library is simple, and I know how to add a script, but I don't know how to detect my eye and detect what element I see.
Maybe there are other ways to detect this.
Thats a bit complicated because you need detect minimal ocular movements and the common webcams, haven't resolution enough, but with some hardware like this project http://pupil-labs.com/pupil/, could do that.
A good solution is tracking.js because this library simulate human behavior with a some algorithms and should be enough to make simple decisions like the columns position.

Implementing undo functionality in JavaScript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
How do I implement a ctrl z in javascript?
After numerous google searches, I stumbled upon the execCommand:
I'm using document.execCommand("undo", false, null), but it doesn't work
with Firefox.
I put in the 2nd and 3rd parameters even though they are optional in Firefox.
Any ideas, insights, suggestions, examples, etc?
Since this hasn't been officially answered I wrote this if this helps at all
Its extends jquery so that it detects ctrl + z. and can be used like this:
$('input').disableUndo();
or if you want it to do something when the user tries to undo
$('input').disableUndo(function(element){
// do custom stuff
});
jsFiddle Demo

Categories