I am using javascript scroll plugin to scroll full page image horizontally. Now what I want is when I click down arrow it skips the next slide and moves to the third one by just passing by the second one.
How can I do that?
You can use html and improve with simply javascript.
To the button, element, arrow or something that will be clicked, but recommend using a (hyperlink):
Go to text
For the text that will receive focus after clicked
<div id="go-to-text">
your text
</div>
To understand The element A, with the attribute href starting with #, lead to another element with the same id, which need not contain the #.
The element has id # + of another html element
Element that receives focus has the ID referring to the element
Related
I have menu list with recent 10 contacts with name and number without navigation link (ie. anchor tag)
I want to select name or number by double clicking on it without closing menu options list. Is this possible?
I used stopPropagation() method to preventing closing menu option. How can I achieve selecting text by double click?
Not sure what you want to accomplish exactly since you didn't provide any code. But from what you are asking I think is what you want to use.
document.getElementById("YourMenuID").getElementsByTagName("a").ondblclick = function(){
//request you value here
};
Say I have a left-side chat bar with chat users. Each user has their image (much like Facebook's chat)and is clickable to open a chat box to start chatting away.
Here's my code:
$('.msg_wrap').hide();
$('.msg_box').hide();
$('.chat_user').click(function() {
$('.msg_wrap').show();
$('.msg_box').show();
}
I know this is wrong but what I want to do here is when the page loads for the first time, all the chatboxes to be hidden (hide ()). It is not until I click on a chat user (.chat_user) that a pop up/chat box appears (show()). How do I fix this code? Do I have to create a function?
A quick thought on a solution.
First. Set the elements ('.msg_wrap') and ('.msg_box') to hidden in your html and kill your first two lines of code. I am not sure what those elements specifically are, but, for example, if they were div tags it would look something like:
<div hidden class="msg_wrap">
Second. I am not sure if you are saying that the code currently isn't working on page load. It looks like you are missing a ) at the end and also you can update to the following so that it gets executed on page load.
$(function(){
$('.chat_user').click(function() {
$('.msg_wrap').show();
$('.msg_box').show();
});
});
This is jquery shorthand for $( document ).ready().
Also, if you want the msg_wrap and msg_box elements to toggle between being hidden and shown you can use the toggle() method instead of show().
I have div of id "TrancriptBox" in page. It contains text of number of lines.
When i scrolls it on iPad it works fine. But if i scrolls and change text of that div. It does not show first line of changed text. It shows scrolled position rather than new texts first line.
Code:
$("#TrancriptBox").text("");
$("#TrancriptBox").text(trancriptText);
"trancriptText" is text parameter passed to div.
Please suggest how to show first line of text whenever new text loads in div.
Simply call scrollTop():
$("#TrancriptBox").text(trancriptText).scrollTop(0);
Given that you're explicitly resetting the text() of the element, you don't need to first unset the text (with .text('')), just apply the method directly with the new variable passed in.
try:
$("#TrancriptBox").empty().html(trancriptText);
I have a div which hides a select box. When a user clicks on the div it disappears and shows the select box. Then when the user clicks away from the select i want the div to show again and essentially cover it up.
so, to hide the div I have the following:
onclick="document.getElementById(\'infoi'.$div_i.'\').style.display = \'none\';"
When the user has touched the select and clicks away I have the following which covers the select again:
<select name="g_name" onchange="this.form.submit();" onblur="document.getElementById(\'infoi'.$div_i.'\').style.display = \'block\';" style=width:170px;>
for this to work as i want it to though, the user has to actually click the select, even without selecting anything, for it to gain focus and therefore the onblur will turn the div back on.
So, I try the following to hide the div and set the focus on the select:
onclick="document.getElementById(\'infoi'.$div_i.'\').style.display = \'none\'; document.getElementById(\'g_name\').focus();"
Bit it simply does not work, any ideas?
I have a working example of what I think you are after here http://jsfiddle.net/Znct3/10/
looking at your code you were applying focus to an element with an ID of g_name but your select only has a name of g_name
I'm looking at creating something like this:
http://konigi.com/interface/kontain-search
alt text http://s3.amazonaws.com/konigi/interface/kontain-search-2.png
I don't suppose anyone has any resources which could guide me? I know I'm not giving much information but I wouldn't know where to start looking.
Cheers!
EDIT Sorry, I meant just the drop down / input box, nothing else on that site.
EDIT AGAIN The drop down list is inside of the input box, hence why I was wondering.
It may be something similar to these examples but with only one main item. and manipulate with jquery each "li" and that action taken
example 1 |
example 2 |
example 3 |
example 4
edition answer: this is done with css.
is all contained in a div -> input + menu.
for the input is removed border styles and background color is the same as the container div.
Well, you put part of the search form in a hidden div and pop it up when the user clicks or hovers on some other element, either inside or outside the form. Use CSS as needed to position the div. Not really sure what problems you could possibly have with something like this.
Maybe you can be more specific and break this problem down in several more focused questions?
I did not drill into the site, but from a logical standpoint, perhaps the search box AND the dropdown are "inside" another element (div?) that forms the complex control...and just formated(CSS)/actions(jQuery) placed on those.
<div id="searchDiv">
<div id="searchText"></div>
<div id="searchDropdown"></div>
<div id="searchButton"><div>
</div>
Easy enough to set somthing like that up.
I think what's going on there isn't that the dropdown is inside an input box, but rather that the input box chrome is hidden and it's placed inside an input-looking div along with the dropdown.