Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Flashlight Javascript or jquery pluggin

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #191088
    chauhanheena
    Participant

    Hi,
    I’m looking for a snippet or a pluggin where
    when i click a link/button,
    the cursor changes to a custom cursor on the mouse down event and then returns to the default.

    when i click the link, a flash light appears on the screen. Like the camera flash light with the click sound.

    Could someone help me with the code?

    thanks

    #191092
    chauhanheena
    Participant

    Hi @Shikkedeil

    please visit my website and from there i can explain what i exactly wish to do and if u could help me out

    http://www.goldensprocketzmedia.com/BlackTheme

    when i click on any of the links,
    the cursor should change to a new custom cursor (
    on mouse down event, and the entire screen should flash for a second (like the camera flash) .i already have addded the code for sound.
    Please let me know the code for this. if u can figure this out

    thanks so much

    #191098
    chauhanheena
    Participant

    Thanks @shikkediel

    Ishall try this code n hopefully its gonna work great. will keep you posted… thanks so much.

    also i had another problem.

    when i open the site in IE.
    if u notice there is a weird behaviour of the custom cursor. if i move the cursor to any of the clickable elements, the cursor disappears and reappears only on a sligh mouse move. Any idea why this is happening.

    the following is the code im usinig

    a, a:hover{cursor: url(../../../../cursors/camera.png), /* Modern – relative to the document /
    url(cursors/camera.cur), /
    IE – relative to the root /
    default !important; /
    Built-in fallback /} /new line added*/

    this works perfect with chrome and firefox. but with IE i see the weird behaviour.

    Ifyou could help

    thanks

    #191103
    chauhanheena
    Participant

    @shikkediel

    gonna try ur code in some time..will keep you posted on this one for surel :)
    thanks

    #191107
    chauhanheena
    Participant

    @shikkediel

    The code dint work as expected.
    the cursor does not change. the sound does play and the flash too does not work as expected. :( I did twist the code a bit n itworked. but IE gives problems.

    #191127
    chauhanheena
    Participant

    @shikkediel

    <!–flash light –>
    <script type=’text/javascript’>//<![CDATA[
    $(window).load(function(){
    $(‘.innerlink’).click(function() {
    $(“.pane”).fadeOut(0).delay(0).fadeIn(0);
    });
    });//]]>
    </script>

    worked for flash. n it works well now :)

    but the cursor code for some reason does not work well. When i click it changes to default arrow cursor and back to the current custom cursor. not as mentioned in the code (to cross hair and back to pointer. I’m actually using a custom cursor n on mouse down i want to use another custom cursor and onmouse up back to the original custom cursor. thats what im trying to do.

    #191147
    chauhanheena
    Participant

    @shikkediel

    what im now doin is


    $('a').one('mouseover', function() { $(this).css('cursor', 'url(cursors/camera.png),url(cursors/camera.cur),default'); }); $('a').on('mousedown', function() { $(this).css('cursor', 'url(cursors/camera1.png),url(cursors/camera1.cur),default'); }); $('a').one('mouseup', function() { $(this).css('cursor', 'url(cursors/camera.png),url(cursors/camera.cur),default'); });

    n whats happens is the following

    the first time i click the link, it works good. the second time i click the same link, the mouseup does not happen and the third time i hover the link, the mouse down cursor is seen. please take a look.

    #191167
    Paulie_D
    Member

    Could it be that you have a typo?

    $('a').one vs $('a').on ??

    http://api.jquery.com/one/

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.