Hi. I recently realised that I was a few versions behind on my Superfish menus, so I'm in the process of upgrading and rebuilding the CSS to match the existing layout. Part of a spring clean to update all jQuery across all sites.
The old version used to have a supposition plugin support (which if I recall was in beta). Including this would stop drop-down menus from flowing off the screen. The latest version doesn't include this, and doesn't seem to mention it.
Does anybody know if there are any options included as default now, or any known workarounds to automatically reposition so menus (try to) stay on screen?
As you can see here, the menu at the top is aligned to the right side of the screen, and the last menu is cropped if the display isn't wide enough (shop menu) - http://apiotest.keypublishing.co.uk/.
However, a working version (v1.4.8) is fine here (although it doesn't work on the latest version of jQuery that I'm updating to) - http://www.key.aero/
Any help greatfully appreciated, since I'm scratching my head here. Thank you.
Hi - first let me start by saying that what I want to achieve is not at all malicious, but I understand how it could potentially be used this way.
- We run about 20 sites and a shop. Most of the sites contain common content (header and footer).
- The shop stores a user's cart summary in a cookie
- I have written an ASP page to write the cart summary to the browser in JSONP format. I know it's ASP, but it does the job
- I have a piece of JQuery on the other sites that polls the JSON cart summary, and updates the html of a shop link if their cart is not empty
- The code works fine in Chrome and Firefox, but not IE. If I visit the ASP page directly in IE, the contents of the cart are correct, but through AJAX, the cart is always empty (suggesting that the cookie is not available
- I'm currently using AJAX rather than getJSON after looking into potential caching issues. This has made no difference
Any ideas?
A few thoughts...
- IE is caching an empty cart. Not so, turned caching off and changed the ASP page's output. Returned code was different, but cart still empty
- When IE uses AJAX it might show up as a different browser, and hence no cookie is available. This is the one I am concentrating on at the moment, but my knowledge is limited such that I'm not sure where to look next.
My code...
On the shop
<%
Response.Expires = -1
itemCount = 0
totalPrice = "£0.00"
cookie = Request.Cookies("CART_CONTENT")
If cookie <> "" then
cookieArray = Split(cookie,"")
itemCount = Trim(cookieArray(3))
If itemCount <> "" then itemCount = Replace(itemCount,Chr(10),"")
totalPrice = Trim(cookieArray(1))
If totalPrice <> "" then totalPrice = Replace(totalPrice,Chr(10),"")
Many apologies if I have made some very basic errors, but I'm just getting started in the whole AJAX/JSON area, and I'm not quite up to speed yet. All help very gratefully appreciated.
I've got a couple of lines of code that works fine, but I can't help thinking it's not as efficient as it could be (I'm not quite thinking jQuery enough yet!).
Essentially, I have a lot of divs in a container and I need to wrap them in pairs. Periodically, I upwrap them again and rewrap (as the content is modified and I need to refresh the layout).
Therefore, for simplicity, I've got something like this...
<div id='container'>
<div class='content'>content 1</div>
<div class='content'>content 2</div>
<div class='content'>content 3</div>
<div class='content'>content 4</div>
<div class='content'>content 5</div>
<div class='content'>content 6</div>
</div>
...and I want to wrap 1 & 2, 3 & 4 and 5 & 6 with, say, <div class='portlet'></div>
... and it works fine, but I'm concerned that in my jQuery innocence, I might be making a bit of a schoolboy error; this might eventually scale up to about 1000 content divs.
Any advice would be greatly appreciated. Really enjoying coding in jQuery - learning something new every day, and not bogged down with browser-specific semantics any more.