JavaScript - jQuery - Ajax

  1. » mowgli
    I use the Fotorama script for a slideshow images. How can I put caption in some photo? How it is possible using this script?
    Thanks in...
    Last post » Admin
    I'm not the person who made the Fotorama script, and because I not use it, I not know very well about its customization.
    If you want to know...

  2. » mowgli
    How to make a Fotorama different list of images for mobile and for desktop?
    For instance: desktop image 1, 2, 3 ... (1400x800) px. Mobile: 1a, 2a,3a...
    Last post » Admin
    I'm glad it works. I think it is not a problem that the slideshow starts from zero when the page rereshes, and anyway, the visitors not play with the...

  3. » Marius
    How can I shuffle /randomize an array in JavaScript? Is there a JavaScript function like shuffle() in PHP?
    Last post » Admin
    You can use this function:
    // receive an array and return it with the items shuffled /randomized
    function shuffle(ar){
    for(var j, x, i =...

  4. » crop
    i read this :

    and i tried to copy it, i made simplified version here:

    - check.php is present, but you can't see...
    Last post » MarPlo
    I replaced the onblur event with onchange . Now, when ALL the input fields are validated, the submit button is enabled and the form is Automatically...

  5. » PloMar
    I have an Ajax function that adds in page some content from server. It was working fine when the page url was with http , but after I put https the...
    Last post » MarPlo
    If the page url is with https , the Ajax request must be made with https . So, make sure you access the file on server with the same protocol...

  6. » PloMar
    I have this JS script:
    function blockToggle(type,blockee,elem){
    var conf = confirm( Press OK to confirm the ' +type+ ' action );...
    Last post » MarPlo
    The error message indicates that there is not a HTML element in page with the id passed in the elem arguments.
    Check the part of your JavaScript...

  7. » PloMar
    I have a dropdown select list like this:
    <select name= sel1 id= sel1 >
    <option value= 1 >text 1</option>
    <option value= 2...
    Last post » MarPlo
    You can use the selectedIndex property to get the ordered index of the selected option, then, with that index you can get the object with the...

  8. » PloMar
    How can I get the filename and extension from a variale with an URL address in JavaScript?
    The URL can be any kind of webpage address; with...
    Last post » MarPlo
    Just use the getFilename() function from this example:
    function getFilename(url){
    // returns an object with {filename, ext}...

  9. » PloMar
    Is it possible to display the content of a Div in full screen window with JavaScript?
    Last post » Admin
    There is fullscreen API in JavaScript, you can use the requestFullscreen() method to display a HTML element in full screen mode, documentation:...

  10. » PloMar
    I have the following code that sends form data with Ajax to a php script. It works, but after the form data is sent, the value added in the...
    Last post » Admin
    You can use the following JavaScript code (in the success section of your Ajax function) when the data have already been sent, to delete...

  11. » PloMar
    I have the following code to send form data to a php script, with jQuery Ajax, withouut reloading the page.
    But, when I press the Submit...
    Last post » Admin
    You have to call preventDefault() method to stop default action.
    $('#form').submit(function(e) {...

  12. » PloMar
    I want to display a file (image) in canvas before it is uploaded.
    The preview action in canvas should be executed all in the browser without...
    Last post » Admin
    You can use URL.createObjectURL() on the File from your <input> to generate a blob object URL.
    Generated URL will be like:...

  13. » PloMar
    I have a canvas element and a form with a text box and a button. I want to be able to put an image url into the text box, and after click on...
    Last post » Admin
    You can use this script. When click on the button, it adds the image from URL in page (into a Div, #pic1), then, the function addCnvImg() gets...

  14. » PloMar
    I have the following code:
    <img src= image.png alt= Image onclick= test(data) />

    function test(prm) {
    Last post » Admin
    If the argument is a string, you should add it between quotes, like this:
    <img src= image.png alt= Image onclick= test('data') />

  15. » PloMar
    Can I make the content of a html div to be editable?
    For example I have the following code:
    <div id= edit1 >Content that can be...
    Last post » MarPlo
    To make the content of a html element to be editable, just add the: contentEditable= true attribute in that tag. It can be used in almost all HTML...

  16. » PloMar
    I have an input text field to which i want to display a tooltip with a html table, when the mouse is over the input field.
    How can i make it...
    Last post » Admin
    Set position:relative; to the parent container (it is important for absolute position), then set position: absolute; , display: none; and...

  17. » PloMar
    How can I refresh the page after a specified time?
    I have a html table with data from server. These data are changed to every 3 minutes, so I want...
    Last post » MarPlo
    You can use the reload() function added in setTimeout().
    // refresh page after 3 min. (true to load from server, not from cache)...

  18. » PloMar
    How can I parse the array items in reverse order, in JavaScript?
    I have a Div and an array with numbers in JS code, like this:
    <div id= dv1...
    Last post » MarPlo
    The simplest way is to use a reverse for() loop (with i-- ).
    See this example:
    <div id= dv1 ></div>
    var ary = ;

  19. » PloMar
    How to add (append) text in textarea using jquery without removing previous text?
    I have this code, but it only works for first time, when i change...
    Last post » MarPlo
    Inside the dom the value and text attributes are stored separately. When you use append the text is appended but the value is blanked because it is...

  20. » PloMar
    I'm drawing text in an HTML5 canvas on top of an image. I want to calculate a font size so that the string will span 200 pixels width.
    Last post » MarPlo
    The fillText() method has an optional fourth argument, which is the max width to render the string.
    - MDN's documentation says:
    maxWidth - the...

  21. » PloMar
    Hello all
    Anyone know how to calculate the number of characters that will fill one line of a div with a fixed width (for example 200px), using...
    Last post » MarPlo
    You can use this formula to get the width of the line for a given number of characters (CPL):
    Width = CPL * (font-size / font-constant)
    - CPL...

  22. » PloMar
    I use this code to animate position of a Div when is hovered. I move it with 2500 animation speed.
    How do I change speed of this animation to 800,...
    Last post » Admin
    Try with the dequeue() function (Execute the next function on the queue for the matched elements).
    <div id= dv >Animate Div</div>...

  23. » PloMar
    Let say I have this html:
    <div id= parent >
    <div id= c1 >Content child 1</div>
    <p id= c2 >Paragraph ...
    Last post » Admin
    Try with the > selector, it refers to the direct childen.
    1. Example get array with the ID of all direct children.
    <div id= parent >...

  24. » PloMar
    How can I use JavaScript /jQuery to follow the mouse cursor with a DIV in the whole page?
    Last post » Admin
    If you want this effect with pure JavaScript, you can use this code:
    #div_moving {
    position: absolute;
    width: 140px;
    height: 65px...

  25. » PloMar
    I'm playing with jQuery. Now I test the trigger() method.
    I try to trigger a custom method and pass two additional arguments (an object and a...
    Last post » Admin
    When you pass multiple arguments with trigger(), and those arguments aren't a number or a string, you should pass all the additional arguments into...