- Screen name: Martin Mazza Dawson
Martin Mazza Dawson's Profile
7 Posts
10 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- I am extending a plugin and have a problem. The initial plugin defines a 'click' event handler like this:$(this.cssSelector.next).click(function(e) {e.preventDefault();self.next();self.blur(this);});I want to provide my own 'click' event handler instead of this one. However, as it doesn't have a namespace I have no way of just removing this handler without affecting the others on that element.
My own event click handler gets binded straight after this one in the next script, so I at the moment I am doing this:$._data($(self.cssSelector.next)[0], "events").click.pop();This works fine and removes the handler without removing other handlers elsewhere in other scripts however I read that this is an internal data structure and should not be modified.Is this a bad way of doing things? If so how do I get around this?I have long base:64 strings that I am putting as the values of hidden elements.
How can I limit how many are shown in the debug inspector? They are really annoying and take up a lot of space.
E.g. Instead of this:
<input name="[0].CoverImagePath" type="hidden" value="/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADZANkDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R">
Just show first few:
<input name="[0].CoverImagePath" type="hidden" value="/9j/4AAQSkZJRgABAQEAYABgAAD/2w..."/>
Like how the
src
attribute cuts off after so many are shown.I have a fake jPlayer audio who's time and progress bar are set to that of the real player so that it looks like they are the same.
Here's that code in the source jPlayer.js file:
updateFakePlayer: function(realjPlayer) { var self = this; var playlistjPlayer = $(realjPlayer.cssSelector.jPlayer).data().jPlayer; this.status.currentTime = playlistjPlayer.status.currentTime; this.status.currentPercentAbsolute = playlistjPlayer.status.currentPercentAbsolute; this.status.currentPercentRelative = playlistjPlayer.status.currentPercentRelative this.status.remaining = playlistjPlayer.status.remaining; this.status.readyState = playlistjPlayer.status.readyState; this._updateInterface(); },
I don't want to load media in the fake player because the user has to download unnecessary extra files.
However, because I am not loading the media in the fake player then the built in html events will not work, most importantly the seeking (where the user clicks on the seek bar and the audio jumps to that position). So how can I emulate this or create my own? I am wanting it so that if the user does an action on one player, it affects the other one. This works great when the user acts on the real player, but obviously not on the fake one. SoundCloud.com does this with their players I think.
- 02-Feb-2016 12:36 PM
- Forum: Using jQuery
I'v been stuck on this for ages.
$(".poster-wrapper.tint").hover(function () { $(this).siblings(".controls").slideDown('fast'); }, function (e) { //Here is where I need if statement. Only slide up if the poster **and** the controls class is not being hovered on $(this).siblings(".controls").slideUp('fast'); });
.controls
is ontop of the.poster-wrapper
, so when I hover over poster wrapper it shows the controls class correctly, but when I hover over controls class they slide away again obviously because the poster is no longer being hovered on. How do I stop this unwanted behavior?Jsfiddle: https://jsfiddle.net/9dzfys87/
I can't use pointer events: none.function jpPlayClick(){ //Code stuff };
Code I have tried so far:
$(document).one("click", '.jp-play', function () { jpPlayClick(); });
I want to run through jpPlayClick() once if the user clicks on it for first time, the current code I have disables all my other clicks on class .jp-play obviously. Best way to do this?
- if (!sessionStorage.getItem('GotTags')) {
- $.ajax({
- url: "Search/GetTags",
- method: "GET",
- datatype: "json",
- success: function (data) {
- sessionStorage.setItem("tags", JSON.stringify(data.songTags.concat(data.albumTags, data.artistTags)));
- sessionStorage.setItem('GotTags', 'true');
- }
- });
- }
-
- $("#searchString").autocomplete({
- source: function (request, response) {
- var tags = JSON.parse(sessionStorage.getItem("tags"));
- var results = $.ui.autocomplete.filter(tags, request.term);
-
- response(results.slice(0, 10));
- },
- minLength: 3
- });
-
My question is can I make use of the Ajax cache to store this information and only go through the function if it isn't cached or is my way fine?
I am not sure how cache works properly yet, how can I access cached variables?- 06-Jul-2015 07:24 AM
- Forum: Using jQuery
I want to show the album name and category element when the corresponding button is pressed for that song. How do I do this? This is the jquery I have at the moment. Thanks for any help.-
$('.song-list-btn').each(function(i, obj) { $(this).on('click', function () { }); }); foreach (var item in Model) { <button class="song-list-btn" type="button"> <span class="fa fa-bars" aria-label="Song Details Menu"></span> </button> @Html.EditorFor(model => item.AlbumName, new { htmlAttributes = new { @class = "form-control details", @placeholder = "Album Name" } }) @Html.ValidationMessageFor(model => item.AlbumName, "", new { @class = "text-danger" }) @Html.EditorFor(model => item.Category, new { htmlAttributes = new { @class = "form-control details", @placeholder = "Category Name" } }) @Html.ValidationMessageFor(model => item.Category, "", new { @class = "text-danger" }) }
- «Prev
- Next »
Moderate user : Martin Mazza Dawson
© 2013 jQuery Foundation
Sponsored by and others.

