Masonry multiple times - jquery-masonry

The jquery masonry script is really cool. But I was curious if anyone knew of a way to multiply it. I'd like to have two containers on the same page using it. Each container in different places.
For my purposes I want to stack one container on top of another. Each with different content.
Bonus points if you can tell me how to use jquery to load more items at the bottom of each container with a load more button. :)

1) You have 2 containers and 2 different names for the container
2) There is a plugin infinityscroll with the masonry plugin

Related

Green square on game canvas using Phaser

Can someone please tell me why I'm getting a green square on my Phaser game canvas as below?
Without seeing any code I can tell you that you'll see that when an image can't be loaded by the Phaser framework.
Open developer tools in your browser of choice and refresh after opening the Network tab. You should see a 404 for one of your images.
I believe if you look at the standard browser console you may also see messages about the name of the asset that it failed to load.
I had a slightly different case. Images were being loaded in the init function, which apparently doesn't work. I renamed that function to preload and suddenly the green squares are gone and the images show up.
My case was also a little different too; it appeared that all my image resources were loaded, but I think I was trying to create the sprites a little too quickly - in order words, I was trying to create and add sprites to my scene before the scene was properly loaded.
I'm going to try waiting until 'scene.scene.isActive(key);' returns a boolean of true.....maybe that's what will solve my issue. Failing that, I might just put in some sort of sleep/await promise of 1 second or something (not ideal, but might work)
ALSO NOTE: Part of the reason I was able to create my sprites too quickly was because I was doing so in my own custom function, not the typical create() function. Actually, the best solution is probably to create my sprites in the create() function and not a custom function...

Can a LayeredLayout be used on Tabs component Tab?

Is it possible to implement a LayeredLayout over a specific Tab within a Tabs container? I would like to place a couple of buttons over an image which takes of much of the screen.
You can put a Container in one of the Tabs and configure that Container to be LayeredLayout

What is the best way to achieve the following customized layout?

I am kind of wondering what the recommended method is for a customized UI. I have about 5 screens, which will share some of the same elements. One is a topbar, kind of like the navigationbar but different. It has the title on the left, no back buttons, a background image and a logo on the right. The other is a menu at the bottom containing and UIImageView for the bar, 3 UIButtons a the moment opening 2 different screens and one opens the Camera. I want to reuse the top bar and bottom bar on all 5 screens. Sort of like one would use a UserControl on ASP.NET.
Currently I have created 5 ViewControllers, which gives me 5 XIB files that I have to put the same elements on and I have to hook up the same events. I would want to create 2 elements (top and bottom bar) which I can reuse across all screens. Or is there a simpler solution to all of this like e.g. 1 screen pushing different middle parts into it or something like that? Quite the beginner at MonoTouch for that matter, so I'd love to know what the way-to-go for something like this is?
If you are not able to customise / reuse the standard UINavigationController etc, you could -
Create a custom UIView in Xamarin / Monotouch for each of your reusable elements, then insert them into each ViewController (programmatically is probably easiest) as required. This would give some code reuse and is akin to the UserControl example you mentioned.
Alternatively for IOS5+ you could create a Custom ViewController Container which has all the common parts in one place and have a single container UIView which you would then switch the rest of your Content ViewControllers as you need to.
I have actually just finished a github example of this which may help -
https://github.com/wickedw/ViewControllerContainer

Nav menu that spans entire container width with constant horizontal padding

I've created a nav menu like in the screenshot below. It spans the entire width of the container and the left/right padding of each menu item is constant. This was easy to do by hardcoding the left/right padding in the CSS, but I want the paddings to be able to change as the site admin edits the menus.
Is there a way to do this with pure CSS (CSS3 is okay)?
This was easy enough to do with jQuery (I totaled up the width of the menu items and calculated the necessary padding). But I ran into some issues on some browsers due to our use of Google Web Fonts. On Chrome and Firefox 4 on Windows (not on Mac), the web font was not loaded at the time that my script ran, resulting in incorrect width measurements. I tried running the script in the jQuery's DOM ready event and in the Google Font API's active event. The active event worked in Chrome but in Firefox 4 it was often fired before the font had been applied.
Thanks in advance.
Here's a jsfiddle of a potential different solution.
Using that layout, and assuming the number of menu items is going to change, you call a recalculation method once a list item is added/removed. In this example provided, I've used YUI3 to do the DOM manipulation, but you could do that a number of ways. Note - I didn't test the javascript function, its "probably working pseudo code".
(You may need to make subtract a further 2% or so from the list item widths, if you're trying to deal with IE6/7)
Use jQuery's .load event as suggested by user thirtydot.

How do you alter the 'page_load' for DotNetNuke

For the main menu, I want the first four links to be blue, and specifically the last four links to be yellow. There will only be eight menu items.
I was thinking of hard coding the yellow links into the menu div, and that way when the page loads the first four menu items (default colour blue) they will be blue, and then my hard-coded links of yellow would load up.
My question is, where can I add the "yellow" code? Where can I hard code my yellow menu items? Or is there a different, better, approach to this?
My first question would be which men u are you implementing? A lot of them have a menuitem_x sort of id that is applied to the menu markup so with the CSS you can do what you want
As for where to place the markup there are a few places
You can do it directly in the skin files (not suggested since you may have to edit a few files)
in the skin .css files (much better place to do it and more maintainable and portable)
in the admin go to Site Settings and use the stylesheet editor to add the classes to the portal stylesheet (better than #1 but not as good as #2 since its now specific to the portal and not the skin so it wont be as portable)
Number 3 - works good if you dont have access to the skin or dont want to change it for other reasons
You could use Javascript within the skin.
We have done simular in the past for DNN menus but i keep away from the skinning side so dont have any examples, sorry.
Google does though :)
I would use one of the specific SEO friendly DNN menu modules that generate clean code that can be followed by search engines. I usually use one of them, except for projects where I don't have SEO concerns. When you have a menu with clean markup, like a list, you can change the colors using jQuery and specifying the first four items. You can probably do it like this, one by one. There may be a better selector for grabbing the first four items which is something I have never used.
Solved it, not as dynamic as I'd like, but it works.
The way I've done it is I'm playing with id tags, rather than class tags. Using ID, I can pick out the individual menu items and apply CSS to them.
Essentially, it looks like I've done what 'codemypantsoff' suggested. Thanks!

Resources