I'd like to know how to obtain the selected text inside a textarea and style it. So I can create my own inline text editor. So if I press a button while I have something highlighted it will turn bold.
I would like to create something that if the width of the window width is lower than or equal to 480px that certain functions will be disabled. Right now I can enable certain functions when I go the the website while the window is already smaller than 480px. But if I increase the window size the functions will still be enabled. The functions should be disabled when the window size is bigger than 480px.
Currently I have made the following code.
$(document).ready(function(){
// checks initial width when browser is opened (works!)
if ($(window).width() <= 480) {
$(".menu").click(function(){
$("nav:first-of-type").slideToggle();
});
$(".submenu-toggle").click(function(){
$(this).next('ul').slideToggle();
$(this).toggleClass("corners");
});
}
// checks if the window changes and then disable functions if the window is bigger than 480px (doesn't work)
Whenever I view my jQuery Mobile website on my iPhone 4 there is a problem. If I press a button which has a transition (for example: slide) to another page, the page the button directs to is shown for less than a second and then the transition occurs. So it comes across very buggy.
Is there any way to prevent the first screen to be shown so the transition is smooth? I already searched on google but nothing seems to work. Except some AJAX loading stuff but I don't know anything about AJAX.
Whenever I add <meta name="apple-mobile-web-app-capable" content="yes"/> between the <head> tags my jQuery mobile css (and maybe even the js, not sure about that) won't load. If I remove the tags everything is shown perfectly but then the bottom and header navigation from safari is shown... Is this a bug or am I doing something wrong? my own css file is being loaded though. I tried clearing cache and history but that doesn't work either.
I made a table and I would like that once you press a table row that it will pop open. I know this is pretty easy but I am missing something. Right now it will open up all divs named test. I want the individual div .test to toggle open which belongs to the right table row.
HTML:
<tr>
<td>7.8</td>
<td><a href="#" class="open_up">The hotel was pretty neat, nice staff and clean rooms.</a> <div class="test"> test 123 </div></td>
<td>Business survey</a></td>
<td>22-09-2011</td>
</tr>
<tr>
<td>7.8</td>
<td><a href="#" class="open_up"> Amazing! </a> <div class="test"> test 123 </div></td>
I have several classes named 'ratings_colored'. They all contain a number from 1 to 10. If the number is below 5.5, the number should become red. If not it should become green.
The code below works, but if the first .ratings_colored is higher than 5.5 it will make ALL the classes green. Even the numbers below 5.5! How do I fix this? I tried using the 'this' but it didn't work either.
I have 5 different div classes, which are called .rating_1, .rating_2, .rating_3, .rating_4, .rating_5. Now I want that if you press any of those 5 divs, that you cannot press anything else for 1,3 seconds. After that you can press them again.
Is there any way to temporary disable any clicks? I've made a jquery code where you press a button and after 1,4 sec it will go to the next screen. But I don't want people to click on anything within those 1,4 sec.
I would like to know how I can retrieve html data with jQuery. With my current project I have all pages in 1 html file (jQuery mobile). Every page has his own ID. Page 1 has id="question_1", and the next one is id="question_2".
Now I would like to retrieve this ID and add +1 to the question. So if you press a buton it will always go to the next page.
I'm making a little mobile survey with jQuery mobile (it's great btw). But the page transition from question to question wont work. Let me explain.
There are 5 buttons you can choose for each question, once you've made your choice it gives feedback in the form of text. After that it should take about 1,5 sec and then it will go to the next question. The problem is that if I use the following code:
It will go from #question1 to #question2 but it wont go to #question3 because if (window.location = "#question2") SETS the location of the page to #question2 so it goes back to #question1 and then back to #question2 again.
What I want is that if you press any of the 5 radio buttons at any page it will go to the next page (for example: from #question2 to #question3). Every page has the same radio buttons,above is just one of them.
Just wondering if it is possible to let a huge blue block be moved 200px to the right and everything that is right of the blue block will move with it? So the elements adjust to the blue block's position
First post here :) This week I started learning jQuery and it's awesome to say by the least!
Anyways, I stumbled upon a problem. This is the situation: There are 2 huge colored blocks just above each other on the page. Both blocks are div's with a class named "blue" and "red" (red is above and blue is beneath). I would like to make an animation with the red block so it will go down about 200px AND the blue block should be pushed away 200px as well. Is this possible? If so, how do I do it?
I just want to have an animation on the red block and the blue block will adapt it's position because it got pushed away. (note: I'm not saying that I should make 2 animations, one for the blue block and the other for the red one and both are going down 200px, I want the blue to change it's position according to the movements of the red block).