jquery

How to prevent from page refresh on submit button click

北城以北 提交于 2021-02-04 16:45:33
问题 i have form with one input and one submit button. <form method='POST' action='' enctype='multipart/form-data' id="form_search"> <input type='hidden' name="action" id="form_1" value='1' /> </span><input id="query" type="text" name="mol" value=""> <input type='submit' value='Search' name="Search" id="Search" /> on form submission form input data goes to php below code if (isset($_POST['Search'])) { $_SESSION["query"] = $_POST["mol"]; $_SESSION["action"] = $_POST["action"]; } i want to avoid

Jquery Brush Size Slider for Canvas HTML5

删除回忆录丶 提交于 2021-02-04 16:44:47
问题 Hello I'm trying to create a brush size slider for my Canvas drawing app, would anyone be able to assist in how to go about this?? A few of the approaches I have found weren't compatible with my Jquery library that I have running my app. thank you :) 回答1: Easy: Create an input element of type range : <input type=range min=1 max=100 id=brushSize> Read its value and apply to lineWidth of the context: $("#brushSize").on("input", function(e) { ctx.lineWidth = $(this).val() }); $("#brushSize").on(

how to append class for nicescroll

白昼怎懂夜的黑 提交于 2021-02-04 16:40:12
问题 I am using nicescroll in my application. I have dedined like $("#Total").niceScroll({ cursorwidth: '8px', cursorborder: 'none', cursorborderradius:'0px', cursorcolor:"#39CCDB" }); but I don't want to give the styles as above. I want to apply these using a class.For that I have implemented like .scroll { cursorwidth: '8px', cursorborder: 'none', cursorborderradius:'0px', cursorcolor:"#39CCDB" } and var scrollbar = $("#Total").niceScroll({}); scrollbar.addClass("scroll"); but is not working

How to find element has specific color using jquery

爷,独闯天下 提交于 2021-02-04 16:39:25
问题 Here is my HTML code <ul id="components"> <li>Computer</li> <li>Mouse</li> <li>Keyboard</li> <li>Printer</li> <li>CPU</li> </ul> #components li:first-child{ color:red; } #components li: nth-child(2){ color:blue; } #components li: nth-child(3){ color:red; } #components li: nth-child(4){ color:red; } #components li: nth-child(5){ color:green; } What I need is a jQuery function which can find all the li elements in red color and can convert the background to yellow I mean something like $("

PHP: parse JSON from jQuery

☆樱花仙子☆ 提交于 2021-02-04 16:30:51
问题 I'm trying to parse a simple JSON string, but I'm not used to do it from PHP . To do my test I've written a page where the data is created; sends request to PHP page to do some tests. How can I access the JSON data from PHP and have it returned back? The string from jQuery: var json_str = '{"id_list":[{"id":"2","checked":"true"},{"id":"1","checked":"false"}]}'; /*'{ "id_list": [ { "id": "2", "checked": "true" },{ "id": "1", "checked": "false" } ] }'*/ $.post ("php_json_parser.php", { data_to

PHP: parse JSON from jQuery

泄露秘密 提交于 2021-02-04 16:30:35
问题 I'm trying to parse a simple JSON string, but I'm not used to do it from PHP . To do my test I've written a page where the data is created; sends request to PHP page to do some tests. How can I access the JSON data from PHP and have it returned back? The string from jQuery: var json_str = '{"id_list":[{"id":"2","checked":"true"},{"id":"1","checked":"false"}]}'; /*'{ "id_list": [ { "id": "2", "checked": "true" },{ "id": "1", "checked": "false" } ] }'*/ $.post ("php_json_parser.php", { data_to

What the difference between classes with space and no space in css, what the use of multiple classes with no space

China☆狼群 提交于 2021-02-04 16:29:34
问题 I am making an accordion using CSS, the below is my use of CSS class without space. I use this to eliminate the animation of padding during slideDown and slideUp effect .acc_container.block{ padding: 20px; } since it stated out that padding is 20 pixels but when i check it seems like no padding at all!! instead, i need to add this in order to let my padding works .acc_container. block{ padding: 20px; } (with space) So what's the difference between the class in CSS with and without a space?

What the difference between classes with space and no space in css, what the use of multiple classes with no space

随声附和 提交于 2021-02-04 16:29:07
问题 I am making an accordion using CSS, the below is my use of CSS class without space. I use this to eliminate the animation of padding during slideDown and slideUp effect .acc_container.block{ padding: 20px; } since it stated out that padding is 20 pixels but when i check it seems like no padding at all!! instead, i need to add this in order to let my padding works .acc_container. block{ padding: 20px; } (with space) So what's the difference between the class in CSS with and without a space?

Get changed value from <select> using jQuery

扶醉桌前 提交于 2021-02-04 16:19:08
问题 I am trying to get the changed value of a <select> input using jQuery . Before change <select class="input" multiple="multiple" name="inputUserRoles[]"> <option value="Administrator">Administrator</option> <option value="Faculty" selected="selected">Faculty</option> <option value="Head of Department">Head of Department</option> <option value="Faculty Coordinator" selected="selected">Faculty Coordinator</option> </select> After change <select class="input" multiple="multiple" name=

Make part of contentEditable unable to delete

我们两清 提交于 2021-02-04 16:14:07
问题 I have a contentEditable Div, and I'd like to be able to "protect" portions of it from deletions. For instance, I have this contentEditable DIV that has an img tag in it I'd like to never get deleted. But I need to maintain the text flow around the image as the user types. http://jsfiddle.net/uk6DA/16/ Is there any way, using formatting of inner DIV's, or any other way. I have experimented with key events but so far only have had sporadic results. 回答1: Look at the Demo http://jsfiddle.net