how is possible to fit a random number or table cells with a min width
(<td>) based on the device's screen width and the rest
of the cells just to wrap underneath?
In some short of way I am looking for a responsive <tr> where the
cells which do not fit in the screen to wrap underneath... ?
Bear in mind that all the cells are with a single <tr> tag.
I am trying to switch between two function based on the screen width, normal/wide screen and mobile. For normal/widescreen I would like to have an overlay functionality and on mobile/tablet I would like to have an accordion function. I have tried a few scripts but I am not happy so far with the results.
Any ideas anybody?
This is my idea so far but it doesnt work:
// Screen width detection
var $window = $(window), $a = $('#map li a'); if ($window.width() < 800) { $a.addClass('mobile'); $a.parents("ul").attr("id", "accordion") // $.function(accord); }else{ $a.addClass('overlay'); // $.function(overlay); }; });
//Accordion function
$(function accord(){ var h2First = $("#accordion h2:first"); var h2 = $("#accordion h2");
I am trying to animate the overview (a brif descrption) of my shopping basket on a clients website but it doesnt work!
In theory sounds dead easy, however, I want that to happen only when the user adds a new product on the basket, so this is what is happening...
When the user adds a new product on the basket, the page (which is the product details page) reloads its self and it deosnt take the user to the basket detials page.
The user can go to the basket page only if s/he wants to.
So what I want to do is, to animate (slide down / slide up) the basket overview IF the basket quantity has changed AND if the basket button has been clicked. This is to prevent the basket overview animating while the user navigating through the website.
So I came up with the following which is based on the combination of the existence of a cookie and the content of the basket before and after the button has been clicked.
This is the idea in words:
shopping basket button click > check the quantity basket has changed > check the button has been clicked and create a cookie > do the animation
$(document).ready(functon(){
//declare vars before the button is clicked
var ButtonAction = ""; // button not clicked yet var Basket = $("#BasketContent").text(); // basket content var Newbasket = ""; // new basket content
$("#button").click(function(){ // click of the shopping basket
ButtonAction = "True"; // set action value of the button to true
var Newbasket = $("#NewBasketContent").text(); //set the NEW basket content to variable which includes the new item
// compaire old and new basket values AND button action is set to True if ($(Basket) != $(NewBasket) && (ButtonAction == "True")){
//if all above three conditions are true then set the cookie $.cookie("SetCookie", "OK")
I am trying to store a cookie when a link is clicked but for some reason it doesnt work 100%. The cookie is stored but not on click but on load (in js terms).
There are some other things too that I am going with the code below e.g. referrer and search referrer in order to determine where the user is coming from... but thats another story!
//if found what we are looking for (IP or part of our domain) then trigger the pop-up box/nyromodal $(document).ready(function () { $('a.nyroModal').trigger('click');
}); } }
// Up to here works fine.... the following doesnt... I tried to use a separate function for the click event but like that it doesnt work at all.
I was wondering if its possible to use jQuery to find and remove/replace an email address from a textarea input either before the form is submitted or after?
I am using nyroModal plugin http://nyromodal.nyrodev.com/ to create a login modal. The idea is, once the user has logged in successfully, to close the nyromodal and redirect him/her to the another url?
I am new to jQuery and I am not 100% sure how to do it.
I have a server side include navigation using classic ASP. I tried to use jQuery cookie which I store the id of the link clicked into it in order to asign a class on that link but not on the current page but on the page that the link is pointing!