Social Web Directory :: Social Network Directory :: Ning Tips and Ning Support
Hi friends!
This is my FIRST tip for the new Ning 3.0 (N3) platform. There will be MANY More!
As of today, I noticed on my N3 site that there was no View Full Size link on photos pages. So I wrote this code to add it under the photo description. If you want to add this feature on your site, please copy this code into your Custom Code box:
[EDITED 3/15/13 to make this work on Google Chrome. EDITED 3/19 so it won't throw js errors when not on photo pages.]
<script type="text/javascript">
// Add View Full Size link to photos on Ning 3.0. By TJ at http://jQueryHelp.ning.com
var jQH_FullSizeURL = x$('.photoDetailPage-image').css('background-image');
if (typeof jQH_FullSizeURL != 'undefined') {
if (jQH_FullSizeURL.length > -1) {
jQH_FullSizeURLStart = jQH_FullSizeURL.indexOf('http')
jQH_FullSizeURL = jQH_FullSizeURL.substr(jQH_FullSizeURLStart, jQH_FullSizeURL.indexOf('?') - jQH_FullSizeURLStart);
var jQH_ViewFullSizeLink = '<a class="xg_sprite xg_sprite-view-fullsize" href="' + jQH_FullSizeURL + '" target="_blank" rel="nofollow">View Full Size</a>';
x$('.photoDetailPage-image').parent().append('<div id="jQH_UnderPhotoDescription">' + jQH_ViewFullSizeLink + '</div>');
}
}
</script>
If you have any trouble copying and pasting this code, you might want to copy and paste it from the attached TEXT file.
Feel free to style the div that holds the new link (div#jQH_UnderPhotoDescription) and/or the link itself (a.xg_sprite-view-fullsize). On my site, it didn't add the icon before the link, which does appear before the link on my 2.0 site.
If you use this tip, I would ask that you keep the comment that tells what the code does and who made it, in your custom code box. But do feel free to change or expand on this code. Just keep my comment in there and then add your own, explaining how you modified my code. THANKS!
I'd like to hear your feedback about how this worked on your site. I imagine there might be bugs or it might not work the same on other sites. This N3 is all so new, but we have to start playing with it and see what happens!
Best wishes!
"TJ"
Tags:
This is great!
Thanks Melinda and Jen!
I mentioned on my site that I put up a tip here, and a few people are talking about this tip on my site as well. So for reference, here's the mention and discussion of this tip on my site:
http://jqueryhelp.ning.com/forum/topics/ning-3-0-jquery-tips
Best wishes!
"TJ"
I and another tester of this code noticed that in FF, when you click the link, the photo comes up full size in another tab, but then when you come back to the photo page with the link on it, the link is stuck in its hover color! Anyone else seeing this with this link and/or with any other link on their Ning 3.0 site?
I'm just not seeing this work on my site. Ning has made the regular size of the photos so damned HUGE (loss of resolution, too!) that nearly all of them are all already "full size."
So, I purposely loaded up a wallpaper that an artist made. I looked at it full size in my browser first to see just how big it was. It was humongous.
Then I loaded it onto 3.0. Hit full size, and it's not showing the actual full size. It's actually SMALLER when you click full size!
Thanks so much for the feedback! Could you provide a link to this test wallpaper on your site?
Thanks!
"TJ"
Here is the link to the background as loaded:
http://writersandreaders.ning.com/graphic-art-no-regular-photos-ple...
Here is what it looks like when I hit "Full Size"
http://storage.ning.com/topology/rest/1.0/file/get/9383908?profile=...
Using Firefox.
The actual image is just 721 px in width but on the page you linked to, Ning uses it as the background image of the div which has a width of 860 px so somehow the image gets zoomed to fit the div. I think this is how Ning did the "Responsive Design" - the div changes as the screen size changes and the image which is the background image for the div automatically resizes as the div resizes. I'm fairly sure that's what's happening but I need to do more research on CSS and Responsive Design :-)
Best wishes!
"TJ"
TJ,
The actual image is larger than that. The same image is posted on my 2.0 network (Ning defaults all images down to 721 in discussion threads). And when I open it in a new tab, it shows it full size and it is WAY larger than 721. These are full screen backgrounds.
Thanks again for the feedback!
I wonder if they are doing it differently in N3 because that image that got stored on Ning is 721 by 420. "http://storage.ning.com/topology/rest/1.0/file/get/9383908?profile=original"
It would be good in a way if they do cap the size of images now when its uploaded to N3, because it is faster to load a smaller image than to load a large image and scale it down with CSS.
_
_
_
Do you have a link to the same image posted on your 2.0 network?
Thanks!
"TJ"
Great work Tj, your skill with the JS has always bought forward some fantastic leaps with our websites here on Ning :)
Thank you for sharing another great one :)
Hi friends,
This code broke when Ning changed the way they display photos. They used to do it with photos as the background image of a div. Now they are back to using the normal img tag. So to fix this, change one line. Change:
var jQH_FullSizeURL = x$('.photoDetailPage-image').css('background-image');
to:
var jQH_FullSizeURL = x$('.photoDetailPage-image img').attr('src');
and that should fix this tip. It did for me on my N3 site.
Best wishes!
"TJ"
Welcome to
JenSocial: Social Web Directory and Ning Tips
Posted by JenSocial on May 7, 2018 at 8:35pm 9 Comments 1 Favorite
Posted by JenSocial on January 6, 2017 at 4:00pm 10 Comments 1 Favorite
Posted by JenSocial on October 22, 2016 at 1:05am 0 Comments 0 Favorites
Posted by JenSocial on September 17, 2016 at 12:00am 26 Comments 1 Favorite
Posted by JenSocial on August 31, 2016 at 3:30pm 13 Comments 0 Favorites
Ning 3.0 Tip - Add Buttons/Links Below Status Update (Quick Links to Add Photos, Posts, Discussions)
Started by Ning.spruz.com in Ning 3.0 Feb 19. 0 Replies 0 Favorites
Started by Evelina in Ning 3.0 Aug 30, 2023. 0 Replies 0 Favorites
Started by Ning.spruz.com in Ning 3.0 Jan 15, 2022. 0 Replies 0 Favorites
© 2024 Created by JenSocial. Powered by
© Copyright JenSocial.